question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"framework not found FirebaseCore" build error

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:28 (18 by maintainers)

github_iconTop GitHub Comments

4reactions
YanivSoscommented, Aug 20, 2021

I think you need to add the linkerOps to your binaries like

linkerOpts("-F${firebase-kotlin-sdk-folder/build}/Firebase/FirebaseAnalytics")

Hi. any idea where this ‘firebase-kotlin-sdk-folder’ directory is? I can’t find it…

2reactions
Reedyukcommented, May 29, 2020

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

framework not found FirebaseCore - Stack Overflow
There is no appropriate error message to alert you to this situation. To fix: Open xcode; Close all projects and workspaces; Close Xcode...
Read more >
ld: framework not found FirebaseCore #168 - GitHub
I have an error when try to execute my app in iOS phone or simulator. I followed the instructions with the page (https://documentation.onesignal ......
Read more >
Framework Not Found with xcode 12 | Apple Developer Forums
With xcode 12 first time build fails for working project with previously installed cocoapods framework: ld: framework not found Pods_CopticFind
Read more >
Framework not found firebase - CodeCrew Community
I can't seem to get past this error in Xcode: I've tried pod install and pod update and still get the same error....
Read more >
[Solved]-Framework not found GoogleMapsCore-swift
They are missing from the project. You need to build them. Look up cocoapods and follow the instructions to create your workspace file....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found