ynsok
01/31/2023, 4:12 PM:core
behaves like an umbrella, And I would like to create a separate module just with analytics. But While I run gradle task assembleXCFramework
I’m receiving this error:
output:
Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_FIRCrashlytics", referenced from:
objc-class-ref in result.o
ld: symbol(s) not found for architecture arm64
Also extra information is printed into the console with this information:
> Task :core:linkDebugFrameworkIosArm64
w: Following libraries are specified to be exported with -Xexport-library, but not included to the build:
/Users/ynsok/AndroidStudioProjects/kmm-project/monitoring/build/libs/iosArm64/main/monitoring-cinterop-FirebaseCrashlytics.klib
Here is partial setup build.gradle.kts
for :monitoring
module
val xcf = XCFramework()
listOf(
iosX64(),
iosArm64(),
iosSimulatorArm64()
).forEach {
it.binaries.framework {
baseName = Module.Monitoring.simpleName
xcf.add(this)
}
}
cocoapods {
summary = "This module contains implementation of analytics and crashlytics"
name = Module.Monitoring.simpleName
ios.deploymentTarget = application.IOSConfig.deployment_target
version = application.IOSConfig.cocoapods_version
homepage = application.IOSConfig.cocoapods_homepage
license = application.IOSConfig.cocoapods_license
framework {
baseName = Module.Monitoring.simpleName
embedBitcode = org.jetbrains.kotlin.gradle.plugin.mpp.BitcodeEmbeddingMode.DISABLE
}
pod("FirebaseCrashlytics")
podfile = project.file("../iosApp/Podfile")
}
Here is partial setup build.gradle.kts
for :core
module
val xcf = XCFramework()
listOf(
iosX64(),
iosArm64(),
iosSimulatorArm64()
).forEach {
it.binaries.framework {
baseName = Module.Core.simpleName
export(project(Module.Monitoring.dependencyName))
xcf.add(this)
}
}
cocoapods {
summary = "The module contains core business logic for Pismo application"
name = Module.Core.simpleName
ios.deploymentTarget = application.IOSConfig.deployment_target
version = application.IOSConfig.cocoapods_version
homepage = application.IOSConfig.cocoapods_homepage
license = application.IOSConfig.cocoapods_license
framework {
baseName = Module.Core.simpleName
isStatic = false
embedBitcode = org.jetbrains.kotlin.gradle.plugin.mpp.BitcodeEmbeddingMode.DISABLE
export(project(Module.Monitoring.dependencyName))
}
podfile = project.file("../iosApp/Podfile")
}
Any Idea what is wrong with this configuration ?a-dd
01/31/2023, 4:29 PMFirebaseCrashlytics
pod when linking the XCFramework. The simplest way to do it is to add this pod also to the core
module’s cocoapods
block. This adds a small overhead with unnecessary cinterop-generation but there will be new api that eliminates it in 1.8.20 (https://youtrack.jetbrains.com/issue/KT-41830)
Or you can build a static framework from core
module. You still will need to provide that binary when linking it into a final app though.Tejeshwar Amirthy
04/11/2023, 4:27 AMe: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld invocation reported errors
The /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld command returned non-zero exit code: 1.
output:
ld: '/kmmproject/build/cocoapods/synthetic/IOS/build/Release-iphoneos/gRPC-RxLibrary/RxLibrary.framework/RxLibrary' does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. file
'/kmmproject/build/cocoapods/synthetic/IOS/build/Release-iphoneos/gRPC-RxLibrary/RxLibrary.framework/RxLibrary' for architecture arm64
> Task :kmm:linkPodDebugFrameworkIosSimulatorArm64
w: Following libraries are specified to be exported with -Xexport-library, but not included to the build:
a-dd
04/11/2023, 3:29 PMTejeshwar Amirthy
04/12/2023, 5:22 PM