https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
y

Yaniv Sosnovsky

03/14/2021, 12:32 PM
Hi guys. I’m trying to include dev.gitlive:firebase-firestore into my kmm project and it works fine until I try to run unit tests on iOS. Whenever I try to run the unit tests I get this error: The /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld command returned non-zero exit code: 1. output: ld: framework not found FirebaseFirestore FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ‘sharedlinkDebugTestIosX64’. Has anyone seen this before?
t

Tijl

03/15/2021, 8:19 AM
this is not a gitlive specific issue, but rather a general missing feature in Kotlin Multiplatform at the moment. for workaround and tracking this issue see https://youtrack.jetbrains.com/issue/KT-44857
also the gitlive repo itself contains similar code (since it’s carthage based it’s more simple)
y

Yaniv Sosnovsky

03/15/2021, 11:47 AM
@Tijl Thanks! I tried to follow the solution in the link you sent, and now the FirebaseFirestore error is replaced with output: ld: framework not found abseil and does not go away, even though I ran the same fix as Firebase… Very weird.. 😞
t

Tijl

03/15/2021, 11:48 AM
are you using cocoapods or carthage?
y

Yaniv Sosnovsky

03/15/2021, 11:48 AM
using cocoapods. Tried to do this in the gradle file:
Copy code
ios() {
        binaries {
            getTest("DEBUG").apply {
                val frameworks = listOf(
                    "abseil"
//                    "BoringSSL-GRPC",
//                    "FirebaseAuth",
//                    "FirebaseCore",
//                    "FirebaseCoreDiagnostics",
//                    "FirebaseFirestore"
//                    "GoogleDataTransport",
//                    "GoogleUtilities",
//                    "gRPC-C++",
//                    "gRPC-Core",
//                    "GTMSessionFetcher",
//                    "leveldb-library",
//                    "nanopb",
//                    "PromisesObjC"
                ).forEach { frameworkName ->
                    val frameworkPath = "${buildDir.absolutePath}/cocoapods/synthetic/IOS/shared/build/Release-iphonesimulator/$frameworkName"
                    println("framework path: $frameworkPath")
                    linkerOpts("-F$frameworkPath")
                    linkerOpts("-rpath", frameworkPath)
                    linkerOpts("-framework", frameworkName)
                }
            }
        }
    }
some of the libraries are commented out at the moment, but tried them all.
t

Tijl

03/15/2021, 11:52 AM
yeah you can also follow the slack link in the issue to get some background, make sure all the paths are really there etc. But it’s not the nicest way to spend your time.
23 Views