firebase – Compose multiplaform – including gitlive library creates error on constructing IOS app

firebase – Compose multiplaform – including gitlive library creates error on constructing IOS app


Created recent venture in compose multiplatform. Ios emulator labored positive and builds.

after that I added Gitlive library it stopped working. That is my construct gradle:

    import org.jetbrains.compose.desktop.software.dsl.TargetFormat
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
import org.jetbrains.kotlin.gradle.dsl.JvmTarget

plugins {
    alias(libs.plugins.kotlinMultiplatform)
    alias(libs.plugins.androidApplication)
    alias(libs.plugins.composeMultiplatform)
    alias(libs.plugins.composeCompiler)
}

kotlin {
    androidTarget {
        @OptIn(ExperimentalKotlinGradlePluginApi::class)
        compilerOptions {
            jvmTarget.set(JvmTarget.JVM_11)
        }
    }

    listOf(
        iosX64(),
        iosArm64(),
        iosSimulatorArm64()
    ).forEach { iosTarget ->
        iosTarget.binaries.framework {
            baseName = "ComposeApp"
            isStatic = true
        }
    }
    
    sourceSets {
        
        androidMain.dependencies {
            implementation(compose.preview)
            implementation(libs.androidx.exercise.compose)
        }
        commonMain.dependencies {
            implementation(compose.runtime)
            implementation(compose.basis)
            implementation(compose.materials)
            implementation(compose.ui)
            implementation(compose.elements.assets)
            implementation(compose.elements.uiToolingPreview)
            implementation(libs.androidx.lifecycle.viewmodel)
            implementation(libs.androidx.lifecycle.runtime.compose)
            implementation(libs.kmpnotifier)
            implementation("dev.gitlive:firebase-database:2.1.0")
        }
    }
}

android {
    namespace = "com.world.bojkot"
    compileSdk = libs.variations.android.compileSdk.get().toInt()

    defaultConfig {
        applicationId = "com.world.bojkot"
        minSdk = libs.variations.android.minSdk.get().toInt()
        targetSdk = libs.variations.android.targetSdk.get().toInt()
        versionCode = 1
        versionName = "1.0"
    }
    packaging {
        assets {
            excludes += "/META-INF/{AL2.0,LGPL2.1}"
        }
    }
    buildTypes {
        getByName("launch") {
            isMinifyEnabled = false
        }
    }
    compileOptions {
        sourceCompatibility = JavaVersion.VERSION_11
        targetCompatibility = JavaVersion.VERSION_11
    }
}

dependencies {
    debugImplementation(compose.uiTooling)
}

so the ONLY LINE I added is:

 implementation("dev.gitlive:firebase-database:2.1.0")

earlier than it labored after that, IOS can’t construct. Xcode offers 2 errors:

1)Undefined image: OBJC_CLASS$_FIRDatabase

2)Linker command failed with exit code 1 (use -v to see invocation)

author avatar
roosho Senior Engineer (Technical Services)
I am Rakib Raihan RooSho, Jack of all IT Trades. You got it right. Good for nothing. I try a lot of things and fail more than that. That's how I learn. Whenever I succeed, I note that in my cookbook. Eventually, that became my blog. 
rooshohttps://www.roosho.com
I am Rakib Raihan RooSho, Jack of all IT Trades. You got it right. Good for nothing. I try a lot of things and fail more than that. That's how I learn. Whenever I succeed, I note that in my cookbook. Eventually, that became my blog. 

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here


Latest Articles

author avatar
roosho Senior Engineer (Technical Services)
I am Rakib Raihan RooSho, Jack of all IT Trades. You got it right. Good for nothing. I try a lot of things and fail more than that. That's how I learn. Whenever I succeed, I note that in my cookbook. Eventually, that became my blog.