Hey Everyone, I’m trying to add RemoteConfig from ...
# multiplatform
c
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:
Copy code
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:
Copy code
ld: framework not found FirebaseABTesting
for this build.gradle:
Copy code
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
l
Is there a reason the library doesn’t/can’t have an iOS app? A sample both allows for easy testing in an app environment and shows others how to integrate your library.
I think this is a limitation of cocoapods, where it needs a Podfile.
c
the ios library resides in a different github repository
I guess we could add an unused ios project to the kmm repo, would that resolve it?
l
In most of my projects, I keep a sample as an extra module in the GitHub repo. Is this internal for work or for public use?
c
internal
l
You can add an unused app. I think you at least need something with a Podfile.
c
seems to get us one step further, now android is complaining
Copy code
androidAndroidTestRelease: Could not find com.google.firebase:firebase-config:.
241 Views