From 01c9e920417891e8cc1cbd7b239f8a8c9d66360f Mon Sep 17 00:00:00 2001 From: Arkadii Ivanov Date: Sat, 15 Jun 2024 11:48:04 +0100 Subject: [PATCH] Updated Kotlin to 2.0.0, Decompose to 3.1.0 and other dependencies --- .gitignore | 1 + app-android/build.gradle.kts | 3 ++- app-desktop/build.gradle.kts | 1 + build.gradle.kts | 1 + compose-ui/build.gradle.kts | 3 ++- .../myapplication/FailingComposable.kt | 21 +++++++++++++++++++ gradle/libs.versions.toml | 9 ++++---- 7 files changed, 33 insertions(+), 6 deletions(-) create mode 100644 compose-ui/src/commonMain/kotlin/com/example/myapplication/FailingComposable.kt diff --git a/.gitignore b/.gitignore index 03fc7fd..31d78f8 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,4 @@ venv /dist /mkdocs_material.egg-info .vscode +.kotlin diff --git a/app-android/build.gradle.kts b/app-android/build.gradle.kts index 436aa2b..0d9d00d 100644 --- a/app-android/build.gradle.kts +++ b/app-android/build.gradle.kts @@ -2,6 +2,7 @@ plugins { alias(libs.plugins.kotlin.android) + alias(libs.plugins.kotlin.compose) alias(libs.plugins.android.application) alias(libs.plugins.jetbrains.compose) } @@ -45,4 +46,4 @@ dependencies { implementation(project(":compose-ui")) implementation(libs.androidx.activity.activityCompose) implementation(compose.foundation) -} \ No newline at end of file +} diff --git a/app-desktop/build.gradle.kts b/app-desktop/build.gradle.kts index 13b78d3..695a143 100644 --- a/app-desktop/build.gradle.kts +++ b/app-desktop/build.gradle.kts @@ -4,6 +4,7 @@ import org.jetbrains.compose.desktop.application.dsl.TargetFormat plugins { alias(libs.plugins.kotlin.multiplatform) + alias(libs.plugins.kotlin.compose) alias(libs.plugins.jetbrains.compose) } diff --git a/build.gradle.kts b/build.gradle.kts index a9c4635..298587d 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -5,6 +5,7 @@ plugins { alias(libs.plugins.android.application).apply(false) alias(libs.plugins.android.library).apply(false) alias(libs.plugins.kotlin.android).apply(false) + alias(libs.plugins.kotlin.compose).apply(false) alias(libs.plugins.kotlin.multiplatform).apply(false) alias(libs.plugins.kotlin.serialization).apply(false) alias(libs.plugins.jetbrains.compose).apply(false) diff --git a/compose-ui/build.gradle.kts b/compose-ui/build.gradle.kts index 01f5373..b47c0e2 100644 --- a/compose-ui/build.gradle.kts +++ b/compose-ui/build.gradle.kts @@ -4,6 +4,7 @@ plugins { alias(libs.plugins.kotlin.multiplatform) alias(libs.plugins.android.library) alias(libs.plugins.jetbrains.compose) + alias(libs.plugins.kotlin.compose) } kotlin { @@ -24,7 +25,7 @@ kotlin { iosArm64(), iosSimulatorArm64() ) - .takeIf { "XCODE_VERSION_MAJOR" in System.getenv().keys } // Export the framework only for Xcode builds +// .takeIf { "XCODE_VERSION_MAJOR" in System.getenv().keys } // Export the framework only for Xcode builds ?.forEach { // This `shared` framework is exported for app-ios-compose it.binaries.framework { diff --git a/compose-ui/src/commonMain/kotlin/com/example/myapplication/FailingComposable.kt b/compose-ui/src/commonMain/kotlin/com/example/myapplication/FailingComposable.kt new file mode 100644 index 0000000..4840e8c --- /dev/null +++ b/compose-ui/src/commonMain/kotlin/com/example/myapplication/FailingComposable.kt @@ -0,0 +1,21 @@ +package com.example.myapplication + +import androidx.compose.foundation.ExperimentalFoundationApi +import androidx.compose.material.Text +import androidx.compose.runtime.Composable +import com.arkivanov.decompose.ExperimentalDecomposeApi +import com.arkivanov.decompose.extensions.compose.pages.Pages +import com.arkivanov.decompose.extensions.compose.pages.PagesScrollAnimation +import com.arkivanov.decompose.router.pages.ChildPages + +@OptIn(ExperimentalFoundationApi::class, ExperimentalDecomposeApi::class) +@Composable +fun FailingComposable() { + Pages( + pages = ChildPages(items = emptyList(), selectedIndex = 0), + onPageSelected = {}, + scrollAnimation = PagesScrollAnimation.Default, // Commenting this line fixes the error + ) { index, _ -> + Text("Item: $index") + } +} diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 7008363..d6474ff 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,7 +1,7 @@ [versions] project = "1.0.0" -kotlin = "1.9.23" +kotlin = "2.0.0" agp = "8.2.0" jvmTarget = "11" @@ -9,17 +9,18 @@ android-minSdk = "24" android-compileSdk = "34" android-targetSdk = "34" -compose-jetbrains = "1.6.2" +compose-jetbrains = "1.6.11" androidx-activityCompose = "1.9.0" -decompose = "3.0.0" -essenty = "2.0.0" +decompose = "3.1.0" +essenty = "2.1.0" [plugins] kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" } kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } +kotlin-compose = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" } kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" } android-application = { id = "com.android.application", version.ref = "agp" } android-library = { id = "com.android.library", version.ref = "agp" }