Hello. I am trying to implement the CrashKiOS libr...
# multiplatform
i
Hello. I am trying to implement the CrashKiOS library in a KMP project, but I am facing an error:
Copy code
The /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld command returned non-zero exit code: 1.
output:
ld: -U and -bitcode_bundle (Xcode setting ENABLE_BITCODE=YES) cannot be used together
when I build the KMP module. I am seeing this issue only when I add the gradle plugin
id("co.touchlab.crashkios.crashlyticslink")
. Any ideas on how to fix this? I am fairly new to iOS development.
a
Do you see this error while building an app from Xcode? Or running a gradle task from terminal?
i
I don’t have this error when I build from Xcode (where I set ENABLE_BITCODE=NO). Just when I run the gradle task
h
At least with the Kotlin Gradle plugin you are able to set bitcode to false in Gradle, but I don't know, if crashlyticslink overwrites this option: https://github.com/hfhbd/ComposeTodo/blob/7ae3c048a970412edc8110eee527448ed274f14a/clients/build.gradle.kts#L34
i
Thanks! That solved the problem. It looks like crashlyticslink does not override it, but I was missing it from the setup
k
The crashkios
crashlyticslink
plugin just adds liker flags that let the build continue without resolving the Crashlytics iOS symbols. That last sentence was probably confusing if you don't do a lot of iOS development 🙂 Basically, CrashKiOS uses cinterop to call the Crashlytics iOS library, but that almost always gets added by the app in Xcode, not in the Kotlin code. However, the compiler wants to resolved everything the code needs, so it'll fail with a link issue. cinterop and 3rd party libraries are complex, summary.
i
Thanks for clarifying