Open joharei opened 1 year ago
I have the same issue.
I'm using the plugin id("co.touchlab.crashkios.crashlyticslink") version "0.8.1"
.
This was enough to fix the linker issue to build the app.
But the test linker task :linkDebugTestIosArm64
fails (also the x86 one). the error is the same as building the app without the plugin:
Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_FIRCrashlytics", referenced from:
objc-class-ref in libco.touchlab.crashkios:crashlytics-cache.a(result.o)
"_OBJC_CLASS_$_FIRExceptionModel", referenced from:
objc-class-ref in libco.touchlab.crashkios:crashlytics-cache.a(result.o)
"_OBJC_CLASS_$_FIRStackFrame", referenced from:
objc-class-ref in libco.touchlab.crashkios:crashlytics-cache.a(result.o)
ld: symbol(s) not found for architecture arm64
I've had the same issue. We're also using cocoapod gradle plugin.
I was able to workaround it by adding the linker options on the freeCompilerArgs
of my Framework configuration
kotlin {
cocoapods {
framework {
configureFramework()
}
}
}
fun org.jetbrains.kotlin.gradle.plugin.mpp.Framework.configureFramework() {
isStatic = false
freeCompilerArgs = listOf(
"-linker-options",
"-U _FIRCLSExceptionRecordNSException " +
"-U _OBJC_CLASS_\$_FIRStackFrame " +
"-U _OBJC_CLASS_\$_FIRExceptionModel " +
"-U _OBJC_CLASS_\$_FIRCrashlytics"
)
The linker plugin is not applying the compiler args when using the new DSL for Kotlin/Native artifacts: https://kotlinlang.org/docs/multiplatform-native-artifacts.html.
I can work around it by specifying the compiler args manually: