firebase-kotlin-sdk: "framework not found FirebaseCore" build error
I’m getting such error while trying to build my multiplatform project on macos:
> Task :linkMultiCoreDebugFrameworkIos FAILED
e: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld invocation reported errors
The /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld command returned non-zero exit code: 1.
output:
ld: framework not found FirebaseCore
My build.gradle file:
buildscript {
ext {
kotlin_version = "1.3.72"
coroutine_version = "1.3.2"
coroutines_play_services = "1.3.5"
serializer_version = "0.13.0"
androidx_lifecycle_version = "2.2.0"
moko_mvvm_version = "0.6.0"
mockk_version = "1.9.3"
firebase_auth_version = "0.2.0"
}
repositories {
google()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "com.android.tools.build:gradle:3.6.3"
classpath 'com.google.gms:google-services:4.3.3'
}
}
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android-extensions'
repositories {
mavenLocal()
jcenter()
google()
maven { url = uri("https://dl.bintray.com/icerockdev/moko") }
}
group 'com.aramso.curtains.backend'
version '0.0.1'
apply plugin: 'maven-publish'
def kotlinPluginId = 'org.jetbrains.kotlin.multiplatform'
final hasPlugin = project.getPlugins().hasPlugin(kotlinPluginId);
if (hasPlugin) {
final Plugin plugin = project.getPlugins().getPlugin(kotlinPluginId)
println 'Plugin already applied - version ' + plugin.properties['kotlinPluginVersion']
} else {
apply plugin: "org.jetbrains.kotlin.multiplatform"
}
android {
compileSdkVersion(29)
defaultConfig {
minSdkVersion(21)
targetSdkVersion(29)
}
sourceSets {
main {
manifest.srcFile 'src/androidMain/AndroidManifest.xml'
java.srcDirs = ['src/androidMain/kotlin']
res.srcDirs = ['src/androidMain/resources']
}
test {
java.srcDirs = ['src/androidTest/kotlin']
res.srcDirs = ['src/androidTest/resources']
}
}
testOptions.unitTests.includeAndroidResources = true
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
kotlinOptions {
jvmTarget = "1.8"
}
}
}
kotlin {
targets {
final def iOSTarget = System.getenv('SDK_NAME')?.startsWith("iphoneos") \
? presets.iosArm64 : presets.iosX64
fromPreset(iOSTarget, 'ios') {
binaries {
framework('MultiCore')
}
}
fromPreset(presets.android, 'android')
}
sourceSets {
commonMain {
dependencies {
implementation kotlin('stdlib-common')
// COROUTINES
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core-common:$coroutine_version"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-play-services:$coroutines_play_services"
// MOKO - MVVM
api "dev.icerock.moko:mvvm:$moko_mvvm_version"
// SERIALIZATION
implementation "org.jetbrains.kotlinx:kotlinx-serialization-runtime-common:$serializer_version"
// FIREBASE AUTH
implementation "dev.gitlive:firebase-auth:$firebase_auth_version"
}
}
commonTest {
dependencies {
implementation kotlin('test-common')
implementation kotlin('test-annotations-common')
implementation "io.mockk:mockk:$mockk_version"
}
}
androidMain {
dependencies {
implementation kotlin('stdlib')
implementation "androidx.lifecycle:lifecycle-extensions:$androidx_lifecycle_version"
implementation "org.jetbrains.kotlin:kotlin-stdlib-common:$kotlin_version"
// COROUTINES
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutine_version"
// SERIALIZATION
implementation "org.jetbrains.kotlinx:kotlinx-serialization-runtime:$serializer_version"
}
}
androidTest {
dependencies {
implementation kotlin('test')
implementation kotlin('test-junit')
}
}
iosMain {
}
iosTest {
}
}
}
configurations {
compileClasspath
}
task packForXcode(type: Sync) {
final File frameworkDir = new File(buildDir, "xcode-frameworks")
final String mode = project.findProperty("XCODE_CONFIGURATION")?.toUpperCase() ?: 'DEBUG'
final def framework = kotlin.targets.ios.binaries.getFramework("MultiCore", mode)
inputs.property "mode", mode
dependsOn framework.linkTask
from { framework.outputFile.parentFile }
into frameworkDir
doLast {
new File(frameworkDir, 'gradlew').with {
text = "#!/bin/bash\nexport 'JAVA_HOME=${System.getProperty("java.home")}'\ncd '${rootProject.rootDir}'\n./gradlew \$@\n"
setExecutable(true)
}
}
}
tasks.build.dependsOn packForXcode
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 30 (16 by maintainers)
Hi. any idea where this ‘firebase-kotlin-sdk-folder’ directory is? I can’t find it…
Did anyone manage to get this working? I am still encountering the
ld: framework not found FirebaseAutherror and I can’t really find the path that @CoreyKaylor is suggesting 😦i think we are going to need to, most people wont know to add it independently. The error messages are pretty hard to work out that this is the issue.
I have this issue on 1.0.0 @nbransby
My main application has !use_frameworks in the Podfile. I’ve added both ‘Firebase/Auth’ and ‘Firebase/Core’ as pod dependencies in the gradle file and it’s able to compile successfully and get loaded from my ios SwiftUI application.