I'm working on a KMP multimodule project for iOS and Android and I have an issue with cocoapods depe...
g

Gradinariu Tiberiu

over 1 year ago
I'm working on a KMP multimodule project for iOS and Android and I have an issue with cocoapods dependencies in submodules. I have an umbrella shared module that has other modules as dependencies. shared (umbrella module) | | build.gradle.kts cocoapods { // standard cocoapods block with dynamic linking ... } sourceSets { commonMain.dependencies { //put your multiplatform dependencies here implementation(project("sharedcore")) } commonTest.dependencies { implementation(libs.kotlin.test) // dependency towards the core module } } - core module build.gradle.kts cocoapods { ... default cocoapods block with dynamic linking } sourceSets { commonMain.dependencies { //put your multiplatform dependencies here implementation(project("sharedlogger")) // dependency towards the logger module } commonTest.dependencies { implementation(libs.kotlin.test) } } - logger module build.gradle.kts cocoapods { ... // standard cocoapods block with dynamic linking pod("FirebaseCrashlytics") { // defines a dependency towards FirebaseCrashlytics pod extraOpts += listOf("-compiler-option", "-fmodules") } } The error I have with this is Execution failed for task 'sharedlinkDebugTestIosSimulatorArm64'. ld: framework 'FirebaseCrashlytics' not found However, the FirebaseCrashlytics pod appears in shared/build/cocoapods/synthetics. Now if I add the FirebaseCrashlytics pod into the umbrella module cocoapods block too I get: e: Compilation failed: Linking globals named 'knifunptr_cocoapods_FirebaseCrashlytics1_FirebaseCrashlyticsVersionNumber_getter': symbol multiply defined! Has anyone experience with this setup? Any idea on how to make it work?