3

We are trying to build a KMM (Kotlin Multiplatform Mobile) app for ios and android. There are c/c++ modules included in this project. At iOS build we are getting this error from a .h file:

error: use of '@import' when modules are disabled

In xcode this seems like an easy problem to fix, but in Android studio, we can't find a solution. I'm thinking this is a Podfile/.podspec issue, but I haven't been able to find any working solution.

Snipe3000
  • 321
  • 3
  • 15

1 Answers1

2

instead of :

@import MyModule;

just try :

#import <MyModule/MyModule.h>
AnderCover
  • 2,488
  • 3
  • 23
  • 42
  • Don't think thats possible in our case. This is a third-party ios library coming in through Cocoapods. – Snipe3000 May 20 '21 at 02:46
  • Ok, and you can't get a precompiled version of this third party dependency ? a xcframework for instance ? – AnderCover May 20 '21 at 07:54
  • 1
    Thanks for this. It set me in the right direction. We just went with a different library, that had the proper import type. – Snipe3000 May 20 '21 at 21:13