firebase-kotlin-sdk: ios test task is failing with: "Id: framework not found FirebaseCore"

Steps to reproduce:

  1. add dev.gitlive:firebase-firestore:1.12.0 to common dependencies
  2. optional step to fix normal ios builds: add iosSimilatorArm64().binaries.framework { isStatic = true }
  3. make sure you have at least 1 test defined in commonTest source set
  4. run :myKmpModule:allTests

Notes: The build is failing only on ios test task, another platform tests are running fine. Looks like isStatic and kotlin.mpp.enableCInteropCommonization flags are not not working on test builds

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Reactions: 1
  • Comments: 17 (8 by maintainers)

Most upvoted comments

In our own project we have a separate repo that simply contains the cocoapods block in gradle, and then use it to retrieve the required LinkerOpts for our project:

https://pl.kotl.in/LaYzHO_uX

Use it as:

val podsToAdd = listOf(// add names of pods to link here)
binaries {
    getTest("DEBUG").apply {
        linkFrameworkSearchPaths(cachedCocoapodsPath) {
            it in podsToAdd
        }
    }
}

@Daeda88 How achieve it with SPM ?

In your project add:

cocoapods {
   pod("FirebaseCore") { version = "10.19.0" }
}

Unfortunately cocoapod dependencies are not transitive so your tests wont be able to find them