https://kotlinlang.org logo
Title
r

ribesg

05/23/2023, 2:34 PM
This looks like a semi-decently detailed error, but I have no idea what to do with it. I guess I'm missing a dependency but how could I know which?
a

Alejandro Rios

05/23/2023, 2:39 PM
Can you show us what dependencies do you have for the project?
r

ribesg

05/23/2023, 2:48 PM
I'm just setting a project up, I'm using a version catalog:
[versions]
android-gradle-plugin = "7.4.2"
android-java = "17"
android-sdk-min = "21"
android-sdk-target = "33"
androidx-activity-compose = "1.7.1"
androidx-appcompat = "1.6.1"
androidx-compose-compiler = "1.4.7"
androidx-core-ktx = "1.9.0"
compose = "1.4.0"
gradle = "8.1.1"
kotlin = "1.8.21"
versions = "0.46.0"

[plugins]
android-application = { id = "com.android.application", version.ref = "android-gradle-plugin" }
compose = { id = "org.jetbrains.compose", version.ref = "compose" }
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
kotlin-native-cocoapods = { id = "org.jetbrains.kotlin.native.cocoapods", version.ref = "kotlin" }
versions = { id = "com.github.ben-manes.versions", version.ref = "versions" }

[bundles]

common-main = [
    "compose-foundation",
    "compose-material",
    "compose-resources",
    "compose-runtime"
]

android-main = [
    "androidx-activity-compose",
    "androidx-appcompat",
    "androidx-core-ktx"
]

[libraries]

androidx-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "androidx-activity-compose" }
androidx-appcompat = { module = "androidx.appcompat:appcompat", version.ref = "androidx-appcompat" }
androidx-compose-compiler = { module = "androidx.compose.compiler:compiler", version.ref = "androidx-compose-compiler" }
androidx-core-ktx = { module = "androidx.core:core-ktx", version.ref = "androidx-core-ktx" }

compose-foundation = { module = "org.jetbrains.compose.foundation:foundation", version.ref = "compose" }
compose-material = { module = "org.jetbrains.compose.material:material", version.ref = "compose" }
compose-resources = { module = "org.jetbrains.compose.components:components-resources", version.ref = "compose" }
compose-runtime = { module = "org.jetbrains.compose.runtime:runtime", version.ref = "compose" }
plugins {
    alias(libs.plugins.android.application)
    alias(libs.plugins.compose)
    alias(libs.plugins.kotlin.multiplatform)
    alias(libs.plugins.kotlin.native.cocoapods)
    alias(libs.plugins.versions)
}

kotlin {

    jvmToolchain(17)

    @OptIn(ExperimentalKotlinGradlePluginApi::class)
    targetHierarchy.default()

    jvm()
    android()
    iosArm64()
    iosSimulatorArm64()

    cocoapods {
        summary = "dummy"
        homepage = "dummy"
        version = "0"
        podfile = project.file("xcode/Podfile")
        framework {
            isStatic = true
        }
    }

}

dependencies {
    "commonMainImplementation"(libs.bundles.common.main)
    "jvmMainImplementation"(compose.desktop.currentOs)
    "androidMainImplementation"(libs.bundles.android.main)
}
k

Konstantin Tskhovrebov

05/23/2023, 2:53 PM
Does the compose support kotlin 1.8.21?
r

ribesg

05/23/2023, 3:00 PM
No idea, I'm just expecting things to work. Isn't it supposed to work?
a

Alejandro Rios

05/23/2023, 3:03 PM
did you use any of the templates to create the project or just add it the things you need it?
k

Konstantin Tskhovrebov

05/23/2023, 3:07 PM
IIRC, compose multiplatform doesn't support 1.8.21 yet
a

Alejandro Rios

05/23/2023, 3:09 PM
If you want you can use this template to start your project(BTW: Konstantin is the author 😅)
r

ribesg

05/23/2023, 3:16 PM
How do you know which version of what supports what?
d

Dima Avdeev

05/23/2023, 5:25 PM