Marcel
11/11/2024, 7:37 PMld: framework 'FirebaseCore' not found
when trying to run my test suite on iOS with the command ./gradlew iosSimulatorArm64Test
. I have tried many things already without any success, and I would be greatly thankful if I could get a hand π π§΅Marcel
11/11/2024, 7:38 PMumbrella
module, and the full app builds and works as expected (I'm adding the Firebase dependencies on both Android and iOS from the main apps, as Gitlive does not include them).Marcel
11/11/2024, 7:39 PM:feature:xxxxxx:linkDebugTestIosSimulatorArm64
Marcel
11/11/2024, 7:40 PMMarcel
11/11/2024, 7:47 PM// 1- Find libraries
val testLibsDir = rootDir.resolve("test-libs/firebase")
val firebaseFrameworkPaths =
testLibsDir.listFiles()
?.filter { it.isDirectory }
?.flatMap { directory ->
directory.listFiles()?.filter { it.isDirectory } ?: emptyList()
}
?.map { "-F$it" }
?: emptyList()
framework {
//...
// 2- Add all libraries with linkerOpts as seen here <https://github.com/leoull/KMM-FirebaseAuth?tab=readme-ov-file#issuecomment-1106932297>
firebaseFrameworkPaths.forEach {
linkerOpts(it)
}
linkerOpts("-ObjC")
}
The structure of my libs folders looks like:
my-project/
βββ test-libs/
βββ firebase/
βββ FirebaseCore/
β βββ ios-arm64_x86_64-simulator/
β βββ FirebaseCore.framework/
βββ FirebaseAuth/
β βββ ios-arm64_x86_64-simulator/
β βββ FirebaseAuth.framework/
βββ FirebaseFirestore/
βββ ios-arm64_x86_64-simulator/
βββ FirebaseFirestore.framework/
I confirmed that I was getting the right paths for the libraries, and even tried to hardcode the paths with no luck.
I also tried adding:
getTest("DEBUG").apply {
linkerOpts("-F${rootProject.rootDir.absolutePath}/test-libs/firebase/FirebaseCore")
linkerOpts("-F${rootProject.rootDir.absolutePath}/test-libs/firebase/FirebaseAuth")
linkerOpts("-F${rootProject.rootDir.absolutePath}/test-libs/firebase/FirebaseFirestore")
linkerOpts("-ObjC")
}
Marcel
11/11/2024, 7:49 PMMarcel
11/11/2024, 7:59 PMit.compilations.all {
if (compilationName == "test" && target.platformType == KotlinPlatformType.native) {
compilerOptions.configure {
freeCompilerArgs.add("-linker-options")
freeCompilerArgs.add("-F/Users/marcel/Workspace/my-project/umbrella/build/cocoapods/synthetic/ios/build/Release-iphonesimulator/FirebaseAuthInterop")
freeCompilerArgs.add("-F/Users/marcel/Workspace/my-project/umbrella/build/cocoapods/synthetic/ios/build/Release-iphonesimulator/FirebaseCore")
freeCompilerArgs.add("-F/Users/marcel/Workspace/my-project/umbrella/build/cocoapods/synthetic/ios/build/Release-iphonesimulator/FirebaseAuth")
freeCompilerArgs.add("-F/Users/marcel/Workspace/my-project/umbrella/build/cocoapods/synthetic/ios/build/Release-iphonesimulator/FirebaseFirestore")
}
}
}
romtsn
11/12/2024, 11:11 AMlinkerOpts("-F${rootProject.rootDir.absolutePath}/test-libs/firebase/FirebaseCore/ios-arm64_x86_64-simulator")
Marcel
11/14/2024, 6:46 PM