Hello! Getting a failure trying to make an archive...
# compose-ios
r
Hello! Getting a failure trying to make an archive with Kotlin
2.1.0
. Downgrading to 2.0.21 works fine. Normal deploy to a device works fine.
Copy code
clang: error: unable to execute command: Bus error: 10
clang: error: linker command failed due to signal (use -v to see invocation)
Should I open a ticket?
1
h
Clean gradle folder cache Invalidate xcode cache and derived data Rebuild
r
Yep I saw your issue, but this doesn't help in my case. Cleaned entire global gradle cache and cleared all cache, still persists.
h
Try reimporting the project from VCS
t
Same issue here. Reverted to 2.0.21 just to get something released.
a
Arg, I'm getting this too. Very annoying. I can't downgrade to 2.0.21 due to a stupid FAKE_OVERRIDE compose bug. Has anyone found any other newer bleeding edge versions that workaround this?
@Pavel Shishkin do you have any more info on this? This is breaking my release build and I can't downgrade to 2.0.21 due to above issue. These two issues effectively mean I can't use Kotlin 2x. I'd love to help unblock it however i can
h
Upload a min. reproducible repo and they might be able to fix it ASAP, I was able to go around the problem by simply deleting the whole gradle cache and xcode derived dara, then reimporting the project from VCS again
a
So you can build & run release mode iOS with kotlin 2.1?
@Hristijan did you invalidate caches in AS, or actually go to your file system and delete from dirs there
h
Both
t
I found a related/similar YouTrack issue (https://youtrack.jetbrains.com/issue/KT-70202/Apple-New-Linker-fails-with-SIGBUS-compiling-XCTest-based-tests) that suggested adding the -ld_classic flag to linkerOptions in gradle. Instead I added this to Other Linker Flags in the iOS project, and I was able to build the app archive using the latest Kotlin 2.1.0 etc. Another way to go for you to go perhaps.
p
I am facing the same issue. Had to downgrade to unblock a release. Has someone reported this bug already? If yes, could please paste the link here so I can keep track? Thanks!!!
a
@Phillipp Correia link is up above here in the thread - KT-73497. Imma try a few of the suggestions here and I'll report back
👍 1
t
I think KT-70202 is a closer fit to the original issue (which is what I am seeing too), and is fixed (worked around) with the -ld_classic switch.
a
Oh awesome!
@tylerwilson did you have to add the linkeropts to every gradle file/module in your proj?
t
I did not add to any gradle, only the Xcode project settings
a
oooh
t
I am building the common xcframework as static.
a
I'm a bit of an iOS n00b; where does one add that in xcode?
t
image.png
a
THANK YOU
👍 2
It worked!! Update: Adding @tylerwilson's suggestion for linker opts, I was able to successfully build & run the release build of my iOS app with Kotlin 2.1.0
🎉 2
p
This workaround indeed worked. Thanks!
j
worked for me, thanks!
t
Hopefully they fix the issue above at some point, since we also get this warning in Xcode:
-ld_classic is deprecated and will be removed in a future release
h
maybe it’s worth mentioning that it’s deprecated in the issue