Hi. We are just getting started with KMM and could...
# multiplatform
h
Hi. We are just getting started with KMM and could use some help/guidance with a specific problem. Here is the situation: We have decided to go with a 3 git-repos configuration; one for the android app, another for the iOS app, and the third for the shared code. The shared repo contains only code (no resources) and we publish a jar and an XCFramework. The Android app has a dependency on the jar and the iOS app has a dependency on the XCFramework. For the shared code, we are using Gradle version 8.0 and multiplatform plugin version 1.8.21, which (if I understand things correctly) automatically gives us Kotlin version 1.8. However, the Android app is using Kotlin version 1.6. This leads to the following build error (when building the Android app):
Copy code
Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.
I assume one way to fix this error is to update the Android app to use Kotlin 1.8. But I wonder if there is a way to generate the jar so that it is compatible with Kotlin 1.6 runtime? In general, it would be good to have the flexibility of using different versions of Kotlin for the shared code and the Android app. I have tried setting the apiVersion to 1.6 (in the build script for the shared code) as per the documentation here. But that didn’t fix the problem.