Closed sacketty closed 1 year ago
Same happens to me, but for firebase-config
.
EDIT:
I have tried many things I've found in this repo and in the original firebase-sdk-ios repo:
isStatic=true
;Nothing worked.
Ok I managed to build by modifying the shares build gradle file. I just added cocoapods.framework.isStatic to true As per the file below.
` plugins { kotlin("multiplatform") kotlin("native.cocoapods") id("com.android.library") }
@OptIn(org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi::class) kotlin { targetHierarchy.default()
android {
compilations.all {
kotlinOptions {
jvmTarget = "1.8"
}
}
}
iosX64()
iosArm64()
iosSimulatorArm64()
cocoapods {
summary = "Some description for the Shared Module"
homepage = "Link to the Shared Module homepage"
version = "1.0"
ios.deploymentTarget = "14.1"
podfile = project.file("../iosApp/Podfile")
framework {
baseName = "shared"
isStatic = true // TODO setting this true solves this err --> ld: framework not found FirebaseAuth
}
}
sourceSets {
val commonMain by getting {
dependencies {
//put your multiplatform dependencies here
// Firebase
implementation("dev.gitlive:firebase-auth:1.8.1")
}
}
val commonTest by getting {
dependencies {
implementation(kotlin("test"))
}
}
}
}
android { namespace = "com.brentsys.dev.myapplication" compileSdk = 33 defaultConfig { minSdk = 24 } `
Why would I use isStatic
anyways? What if the iOS app already imports firebase? There will be conflicts because of the redefinition of the Firebase libs.
The /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld command returned non-zero exit code: 1. output: ld: framework not found FirebaseAuth error: Compilation finished with errors
FAILURE: Build failed with an exception.
What went wrong: Execution failed for task ':shared:linkDebugFrameworkIosX64'.
Try:
Get more help at https://help.gradle.org
BUILD FAILED in 8s 2 actionable tasks: 1 executed, 1 up-to-date
Here is an example project that demonstrates the issue: https://github.com/iamthearm/FirebaseKMMTest