Hello ! :wave: When trying to build a Kotlin Multi...
# multiplatform
l
Hello ! 👋 When trying to build a Kotlin Multiplatform project on macOS ARM 64, I always have the following compilation error:
Copy code
The /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld command returned non-zero exit code: 1.
output:
-macosx_version_min has been renamed to -macos_version_min
ld: unknown options: -sdk_version
Does anybody managed to solve this issue? The project uses Gradle 8.10.2 and Kotlin 1.8.22. My device has Xcode 16.0.
t
@Andrey Yastrebov could you help here? fyi @Timofey Solonin
👌 1
wait, you should update your project to Kotlin 2.0.21 where support for XCode 16 was added
👍 1
l
@tapchicoma The project is a Kotlin Multiplatform library. Thus, upgrading to Kotlin 2.0.21 will break the compatibility for consumers, which is not ideal for testing it locally... Do you have another solution that is backward compatible?
m
You can still benefit from Kotlin 2.0.21 tooling while compiling your library against an older version of kotlin, thus avoid breaking compatibility for your users, I strongly recommend you to read this: https://blog.alllex.me/posts/2023-11-03-liberal-library-tooling/ And for a reference implementation you can take a look at my lib's configuration: https://github.com/mr3y-the-programmer/PodcastIndex-SDK/blob/main/gradle/libs.versions.toml You can see that I'm compiling my library against Kotlin 1.9 while taking advantage of Kotlin 2.0.20 (and any later version) tooling Edit: as per Yahor's reply, it seems that this is not the case for Kotlin native compiler.
☝️ 1
👀 1
t
for KMP it is slightly different story for older KMP versions sad panda
sad panda 2
Do you have another solution that is backward compatible?
AFAIK unfortunately no as XCode version is currently coupled with Native compiler version @sergey.bogolepov correct me if I am wrong
s
Yahor is right.
l
Alright @tapchicoma, thanks anyway. I will plan on upgrading Kotlin for solving that very soon then.