There seems to be a compatibility issue with the l...
# multiplatform
a
There seems to be a compatibility issue with the latest Xcode 15 beta 3, all KMM build tasks fail with linker errors:
Copy code
The /Applications/Xcode-15.0.0-beta.3.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld command returned non-zero exit code: 1.
output:
ld: warning: ignoring duplicate library '-ldl'
ld: unknown options: -ios_simulator_version_min -sdk_version 
error: Compilation finished with errors
This is reproducible with https://github.com/Kotlin/kmm-basic-sample and doesn’t happen on beta 2.
My guess is Apple (accidentally?) removed the backwards compatible argument format for the new linker. Hopefully it’s added back in the next beta. I keep forgetting to file a Feedback with Apple
a
Thanks, @Jon Bailey, this flag helps 👍 It doesn’t exist in Xcode 14 though, so adding support for beta 3 means breaking the build on Xcode 14, do you have any ideas on how to check dynamically for the compiler version?
j
Are you using embedAndSignAppleFrameworkForXcode from within an Xcode run script build phase? If so I think you could access the environment variables in the gradle file, one of which would give the Xcode version in some form, and then only add the flag depending on that. I’ll have a look in a bit.
Currently I have a separate branch for Xcode 15 so I’ve just added it there
a
Yup, I use
embedAndSignAppleFrameworkForXcode
Copy code
if (System.getenv("XCODE_VERSION_MAJOR") == "1500") {
    linkerOpts += "-ld64"
}
Seems to work fine, except for cases when I need to build directly from command line e.g.
shared:assembleSharedReleaseXCFramework
, but I don’t use it much
j
Yep, you could always set it on the command line manually in that case.
XCODE_VERSION_MAJOR=1500 ./gradlew shared:assembleSharedReleaseXCFramework
239 Views