Hey there!, I’m having some trouble when using a c...
# multiplatform
r
Hey there!, I’m having some trouble when using a cocoapods dep in the ios build, It was working well and now I’m suspecting that xcode new version has messed up something. I’m getting
Copy code
Exception in thread "main" java.lang.Error: /var/folders/0d/4r7ddycs7msfghjht2w29hdw0000gq/T/12354154991012977801.m:1:9: fatal error: could not build module 'Foo'
        at org.jetbrains.kotlin.native.interop.indexer.UtilsKt.ensureNoCompileErrors(Utils.kt:192)
        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:531)
        at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.processCLib(main.kt:268)
        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)
in the interop task
:sdk:cinteropFooIosArm64
It is very hard to get any clue with that error 😞
v
Hi, this is a known issue - https://youtrack.jetbrains.com/issue/KT-48807 Please try a workaround suggested there.
p
yeah, just add
Copy code
compilerOpts("-DNS_FORMAT_ARGUMENT(A)=")
to your
cinterops.creating{…}
block
r
thanks for answering! I saw the ticket but I’m using cocoapods to specify the dependency, I’m doing:
Copy code
pod("Foo") {
            source = path(project.file("../foo"))
            extraOpts = listOf("-compiler-option -DNS_FORMAT_ARGUMENT(A)=")
        }
with no luck 😞
tried different approaches like -compilerOpts or -compiler-options but same result, when using it I get this error
Copy code
Exception in thread "main" java.lang.IllegalStateException: Unknown option -compiler-option -DNS_FORMAT_ARGUMENT(A)=
Usage: cinterop options_list
Oh, actually
Copy code
extraOpts = listOf("-compiler-option", "-DNS_FORMAT_ARGUMENT(A)=")
Did the job 🎉