Travis Reitter
12/02/2024, 5:58 PMfirebase-kotlin-sdk
to the iOS side of my KMM project but hitting a linking error I can't resolve. Specifically, the tutorial has me add the official FirebaseFirestore
framework (from firebase-ios-sdk
) to my iOS project since firebase-kotlin-sdk
doesn't automatically resolve transitive dependencies for iOS. I added that framework to the iOS project and it built normally. Then I added the following lines to my shared
library `build.gradle.kts`:
kotlin { sourceSets { commonMain.dependencies {
// next line is the problem
implementation("dev.gitlive:firebase-firestore:1.8.1")
implementation("dev.gitlive:firebase-common:1.8.1")
and now iOS builds fail to link:
ld: warning: ignoring duplicate libraries: '-ldl'
ld: framework 'FirebaseFirestore' not found
> Task :shared:linkDebugFrameworkIosSimulatorArm64 FAILED
error: Compilation finished with errors
The build log doesn't give any more detail but I've narrowed it down to the dev.gitlive:firebase-firestore
dependency since commenting out that line un-breaks the build.
Is there any way to get more info on exactly what's failing? As far as I can tell, the iOS project (and the app target, specifically) include FirebaseFirestore
among the linked frameworks and I don't see any download error. I already have been using firebase-ios-sdk
and the other products (eg, FirebaseAuth
) without a problem on iOS.
I'd greatly appreciate any help. Thanks!Eduardo Ruesta
12/02/2024, 7:14 PMfun initialise() {
Firebase.initialize()
Firebase.analytics.setAnalyticsCollectionEnabled(true)
}
and this call it from iOSApp.swift file:
@main
struct iOSApp: App {
@UIApplicationDelegateAdaptor(AppDelegate.self) var appDelegate
init() {
MainViewControllerKt.initialise()
}
var body: some Scene {
WindowGroup {
ContentView()
}
}
}
Travis Reitter
12/02/2024, 7:16 PMfirebase-kotlin-sdk
yetTravis Reitter
12/02/2024, 7:18 PMfirebase-kotlin-sdk
in my commonMain
dependencies is causing this link error. The build output in Xcode is so massive I'm having trouble even finding the actual ld
link commandEduardo Ruesta
12/02/2024, 7:19 PMEduardo Ruesta
12/02/2024, 7:19 PMTravis Reitter
12/02/2024, 7:27 PMld: framework 'FirebaseCore' not found
which seems like it should just be a matter of adding that product to the framework dependencies but that isn't an option unlike FirebaseAuth
, FirebaseFirestore
, etc. Might be internalEduardo Ruesta
12/02/2024, 7:28 PMTravis Reitter
12/02/2024, 8:04 PMFirebaseCore
as an option to add as a framework but it's still unavailable at link timeTravis Reitter
12/02/2024, 9:09 PM