Hey Everyone, I’m trying to add RemoteConfig from the <firebase-kotlin-sdk> to a KMM Library without...
c

Cas Van Luijtelaar

about 3 years ago
Hey Everyone, I’m trying to add RemoteConfig from the firebase-kotlin-sdk to a KMM Library without an included IOS app. when I add the lib to the KMM starter app, I have no issue:
kotlin {
    android()
    iosX64()
    iosArm64()
    iosSimulatorArm64()

    cocoapods {
        summary = "Some description for the Shared Module"
        homepage = "Link to the Shared Module homepage"
        ios.deploymentTarget = "14.1"
        podfile = project.file("../iosApp/Podfile")


        framework {
            baseName = "shared"
        }
    }

    sourceSets {
        val commonMain by getting {
            dependencies {
                implementation("dev.gitlive:firebase-config:1.6.2")
            }
        }
        val commonTest by getting {
            dependencies {
                implementation(kotlin("test"))
            }
        }
        val androidMain by getting
        val androidTest by getting
        val iosX64Main by getting
        val iosArm64Main by getting
        val iosSimulatorArm64Main by getting
        val iosMain by creating {
            dependsOn(commonMain)
            iosX64Main.dependsOn(this)
            iosArm64Main.dependsOn(this)
            iosSimulatorArm64Main.dependsOn(this)
        }
        val iosX64Test by getting
        val iosArm64Test by getting
        val iosSimulatorArm64Test by getting
        val iosTest by creating {
            dependsOn(commonTest)
            iosX64Test.dependsOn(this)
            iosArm64Test.dependsOn(this)
            iosSimulatorArm64Test.dependsOn(this)
        }
    }
}
but when adding it to a project that does not have an “iosApp podfile” but I get an error:
ld: framework not found FirebaseABTesting
for this build.gradle:
kotlin {


    cocoapods {
        summary = "Some description for the $libBaseName."
        homepage = libSiteUrl
        ios.deploymentTarget = iosDeploymentTarget
        authors = libDeveloperOrg
        version = libBaseVersion
        license = "Unlicensed"
        name = libBaseName
        source = "{ :git => '$libGitUrl', :tag => '$libBaseVersion' }"
        extraSpecAttributes["vendored_frameworks"] = "'$libBaseName.xcframework'"
        xcodeConfigurationToNativeBuildType["CUSTOM_RELEASE"] =
            org.jetbrains.kotlin.gradle.plugin.mpp.NativeBuildType.RELEASE


        framework {
            isStatic = false
            baseName = libBaseName
            exportedProjects.forEach {
                export(project(":$it"))
            }

        }
        specRepos {
            url("<https://github.com/Kotlin/kotlin-cocoapods-spec.git>")
        }
    }

    sourceSets {
        val commonMain by getting {
            dependencies {
               implementation("dev.gitlive:firebase-config:1.6.2")
            }
        }
    }
}
I hope I’m missing something obvious
👀 2