Hi, I am having issues with cocoapods integration....
# multiplatform
a
Hi, I am having issues with cocoapods integration. Below is the cocoapods block in build.gradle.kts file
Copy code
cocoapods {
    summary = ""
    homepage = ""
    frameworkName = ""

    pod("Mixpanel")
    pod("FirebaseCore")
    pod("FirebaseMessaging")
    pod("SSZipArchive")
}
I get the following error when running gradle sync.
Exception in thread "main" java.lang.Error: /var/folders/ny/hf6sbtc5337bl6g_tcy7kcg80000gp/T/4577319926544642637.m:1:9: fatal error: module 'FirebaseCore' not found
   
at org.jetbrains.kotlin.native.interop.indexer.UtilsKt.ensureNoCompileErrors(Utils.kt:152)
    at org.jetbrains.kotlin.native.interop.indexer.ModuleSupportKt.getModulesASTFiles(ModuleSupport.kt:68)     at org.jetbrains.kotlin.native.interop.indexer.ModuleSupportKt.getModulesInfo(ModuleSupport.kt:14)     at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.buildNativeLibrary(main.kt:515)     at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.processCLib(main.kt:266)     at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.interop(main.kt:76)     at org.jetbrains.kotlin.cli.utilities.InteropCompilerKt.invokeInterop(InteropCompiler.kt:45)     at org.jetbrains.kotlin.cli.utilities.MainKt.mainImpl(main.kt:38)     at org.jetbrains.kotlin.cli.utilities.MainKt.main(main.kt:60)
a
Hi, do you have the same error if you run sth like that in your terminal?
Copy code
./gradlew :shared:build
I regularly see this “not found” error but it’s turned out it kinda an intermediate error. The real error is appeared if I run build via ./gradlew in a terminal
v
Hi, check if you have cocoapods-generate installed also add deployment target to the cocoapods block: cocoapods { ios.deploymentTarget = “14.0” }
a
yes, its the same error if I run
./gradlew :shared:build
for me this error is consistent on some machines. This is not an issue on my dev machine. But consistent on the build machine. Any ideas?
a
There is a quite old bug about that, probably it worths starring it: https://youtrack.jetbrains.com/issue/KT-42167 To fix that I try to do some magic • run this cinterop command manually via ./gradlew sharedcinterop<lib> (you need to paste task you see in your error log). If it runs without error I return back to Android Studio and it builds fine • if the above doesn’t work then I run ./gradlew sharedcinterop<lib> --scan. It seems it invalidates some caches and might help • if the above doesn’t help I try to reboot Android Studio/my computer that’s really annoying. But after updating to the kotlin version 1.5.21 I see this error much more rarely.
a
ok thanks, will try it out.