3

I just released a first version of my Kotlin MPP as a library 3 days ago. It was integrated on Android and iOS successfully. After the first released I switched to a coworkers branch and invalidated my caches. Since then I am not able to sync gradle anymore.

I'm getting this error:

Task :cinteropSnowplowTrackerIosArm64 Exception in thread "main" java.lang.Error: /var/folders/gv/rc4dmzjs3wj9kt4kr00nwhdw0000gn/T/13496315139908854548.m:1:9: fatal error: could not build module 'SnowplowTracker' 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)

Even after going back to my very first POC commits, which was successfully published several times I am not able to build anymore. Here is how I integrated the iOS dependency. I don't have any idea what the issue is. I tried setting a whole bunch of different JDK versions (8, 11, 14, 15, 16, 17) without success. I tried upgrading Kotlin version from 1.4.20 to 1.5.x. I tried downgrading IntelliJ IDEA and many more things all without success. The only guess I have right now is that it is related to some plugin updated. How could I verify that?

Here is how the pod is integrated:

   cocoapods {
    ios.deploymentTarget = "12"
    summary = "Kaia tracking library"
    homepage = "https://github.com/KaiaHealth/kaia-tracking-library"
    authors = company

    pod("SnowplowTracker") {
        version = "~> 1.2.0"
    }
}
4ndro1d
  • 2,926
  • 7
  • 35
  • 65

3 Answers3

1

With credits to xoif as he answered this on youtrack. The problem seems to be xcode command line tools 13 and the solution is to downgrade:

  1. Download Xcode 12.5
  2. Select Xcode 12.5.1 as default Command Line Tool (in Xcode -> Preferences -> Locations)
  3. cinterop should work again.
4ndro1d
  • 2,926
  • 7
  • 35
  • 65
0

I think it has something to do with recent Xcode/toolchain update. I've got the same problem with other cocoapod that was compiling fine last week. I've just removed the pod for now, but probably if there's a way to downgrade xcode toolchain - it might help.

0

Im glad the xcode downgrade helped some of you. Some of the issues regarding Xcode 13 and Clang/cinterop will be supposedly fixed with Kotlin 1.6.0. However, the current preview (1.6.0-M1) still fails for me because of other issues. If I find a way to make my configuration run with kotlin 1.6.0 and Xcode 13, I'll let you know in this thread.

xoif
  • 171
  • 3