Search code examples
iosobjective-cimportcocoapodskmm

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


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.


Solution

  • instead of :

    @import MyModule;
    

    just try :

    #import <MyModule/MyModule.h>