android – Kotlin multiplatform gradle sync points

android – Kotlin multiplatform gradle sync points


Since i began studying to make use of kotlin multiplatform with compose, im having points with gradle sync on a regular basis and that i want to know what it means. im posting an instance error however it occurred with many libraries, and even with these which have been positive only a week in the past. Subsequently i would really like know what im doing fallacious so i can transfer on

Instance error:
:composeApp:iosArm64Main: Couldn’t resolve org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3.
Required by:
venture :composeApp > com.google.android.materials:materials:1.12.0 > androidx.exercise:exercise:1.8.0 > androidx.lifecycle:lifecycle-viewmodel-savedstate:2.8.5

construct.gradle.kts


plugins {
    alias(libs.plugins.kotlinMultiplatform)
    alias(libs.plugins.androidApplication)
    alias(libs.plugins.composeMultiplatform)
    alias(libs.plugins.composeCompiler)
    alias(libs.plugins.ksp)
    alias(libs.plugins.ktorfit)
    alias(libs.plugins.buildkonfig)
    alias(libs.plugins.serialization)
}

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

    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.parts.assets)
            implementation(compose.parts.uiToolingPreview)
            implementation(libs.androidx.lifecycle.viewmodel)
            implementation(libs.androidx.lifecycle.runtime.compose)
            implementation(libs.androidx.compose.google.fonts)
            implementation(libs.ktorfit)
            implementation(libs.kotlinx.serialization.json)
            implementation(libs.ktorfit.converters.name)
            implementation(libs.qr.package)
            implementation(libs.androidx.navigation)
            implementation(libs.androidx.compose.materials)
        }
    }
}

android {
    namespace = "xxx"
    compileSdk = libs.variations.android.compileSdk.get().toInt()

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

    composeOptions {
        kotlinCompilerExtensionVersion = "1.5.15"
    }

}

dependencies {
    debugImplementation(compose.uiTooling)
}

buildkonfig {
    packageName = "xxx"

    xxx

    }

}

libs.versons.toml

[versions]
agp = "8.7.2"
android-compileSdk = "35"
android-minSdk = "31"
android-targetSdk = "34"
androidx-activityCompose = "1.9.3"
androidx-appcompat = "1.7.0"
androidx-constraintlayout = "2.2.0"
androidx-core-ktx = "1.15.0"
androidx-espresso-core = "3.6.1"
androidx-lifecycle = "2.8.4"
androidx-test-junit = "1.2.1"
androidx-material = "1.12.0"
androidx-compose-google-fonts="1.7.5"
androidx-navigation = "2.8.0-alpha10"
compose-multiplatform = "1.7.0"
junit = "4.13.2"
kotlin = "2.0.21"
ktorfit = "2.2.0"
ksp = "2.0.21-1.0.28"
okio = "3.9.1"
buildkonfig = "0.15.2"
serialization-json = "1.7.3"
qrkit = "3.0.5"

[libraries]
kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", model.ref = "kotlin" }
kotlin-test-junit = { module = "org.jetbrains.kotlin:kotlin-test-junit", model.ref = "kotlin" }
junit = { group = "junit", title = "junit", model.ref = "junit" }
androidx-core-ktx = { group = "androidx.core", title = "core-ktx", model.ref = "androidx-core-ktx" }
androidx-test-junit = { group = "androidx.take a look at.ext", title = "junit", model.ref = "androidx-test-junit" }
androidx-espresso-core = { group = "androidx.take a look at.espresso", title = "espresso-core", model.ref = "androidx-espresso-core" }
androidx-appcompat = { group = "androidx.appcompat", title = "appcompat", model.ref = "androidx-appcompat" }
androidx-compose-google-fonts = { group = "androidx.compose.ui", title = "ui-text-google-fonts", model.ref = "androidx-compose-google-fonts"}
androidx-compose-material = { group = "com.google.android.materials", title = "materials" , model.ref = "androidx-material"}
androidx-constraintlayout = { group = "androidx.constraintlayout", title = "constraintlayout", model.ref = "androidx-constraintlayout" }
androidx-activity-compose = { module = "androidx.exercise:activity-compose", model.ref = "androidx-activityCompose" }
androidx-lifecycle-viewmodel = { group = "org.jetbrains.androidx.lifecycle", title = "lifecycle-viewmodel", model.ref = "androidx-lifecycle" }
androidx-lifecycle-runtime-compose = { group = "org.jetbrains.androidx.lifecycle", title = "lifecycle-runtime-compose", model.ref = "androidx-lifecycle" }
androidx-navigation = { group = "org.jetbrains.androidx.navigation", title = "navigation-compose", model.ref = "androidx-navigation"}
ktorfit = { group = "de.jensklingenberg.ktorfit", title = "ktorfit-lib", model.ref = "ktorfit"}
squareup-okio = { group = "com.squareup.okio", title = "okio", model.ref = "okio" }
buildkonfig = { group = "com.codingfeline.buildkonfig", title = "buildkonfig-gradle-plugin", model.ref = "buildkonfig"}
kotlinx-serialization-json = { group = "org.jetbrains.kotlinx", title = "kotlinx-serialization-json", model.ref = "serialization-json"}
ktorfit-converters-call = { group = "de.jensklingenberg.ktorfit", title = "ktorfit-converters-call", model.ref = "ktorfit"}
qr-kit = { group = "community.chaintech", title = "qr-kit", model.ref = "qrkit"}

[plugins]
androidApplication = { id = "com.android.utility", model.ref = "agp" }
androidLibrary = { id = "com.android.library", model.ref = "agp" }
composeMultiplatform = { id = "org.jetbrains.compose", model.ref = "compose-multiplatform" }
composeCompiler = { id = "org.jetbrains.kotlin.plugin.compose", model.ref = "kotlin" }
kotlinMultiplatform = { id = "org.jetbrains.kotlin.multiplatform", model.ref = "kotlin" }
ksp = { id = "com.google.devtools.ksp", model.ref = "ksp" }
ktorfit = { id = "de.jensklingenberg.ktorfit", model.ref = "ktorfit" }
buildkonfig = { id = "com.codingfeline.buildkonfig", model.ref = "buildkonfig"}
jvm = { id = "org.jetbrains.kotlin.jvm", model.ref = "kotlin" }
serialization = { id = "org.jetbrains.kotlin.plugin.serialization", model.ref = "kotlin"}

Leave a Reply

Your email address will not be published. Required fields are marked *