nhatduy
nhatduy

Reputation: 341

iOS KMP Command PhaseScriptExecution failed with a nonzero exit code

I have a Kotlin multiplatform project, I can build Android app, but I cannot build iOS app. The full error message below.

Exception in thread "main" java.lang.Error: /var/folders/2d/bfr1v4wn0nd926jj62ztw0m80000gn/T/9075457888541413881.m:1:9: fatal error: module 'FirebaseFirestore' 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)

:shared:firebase:messaging:cinteropFirebaseMessagingIos (Thread[Execution worker for ':' Thread 4,5,main]) completed. Took 6.427 secs.

Please help me on this, thank you so much.

Upvotes: 1

Views: 600

Answers (1)

Róbert Nagy
Róbert Nagy

Reputation: 7680

If you dive deeper into the stacktrace you can find that cinterop fails with: module FirebaseFirestore not found

Possible solutions:

  1. Make sure you reference firebase pods properly with the cocoapods gradle plugin: FirebaseFirestore instead of Firebase/Firestore for ex.
  2. Check out the following issues if 1) is not a problem https://youtrack.jetbrains.com/issue/KT-42038 and https://youtrack.jetbrains.com/issue/KT-47935

Upvotes: 1

Related Questions