Android Studio KMM Project with c/c++ module Error

291 Views Asked by At

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.

1

There are 1 best solutions below

3
On BEST ANSWER

instead of :

@import MyModule;

just try :

#import <MyModule/MyModule.h>