Skip to content

Commit e472f98

Browse files
authored
Update to Compose 1.8 (#1555)
I have updated all projects to the latest version of Compose (1.8) which was released today. [More info here](https://android-developers.googleblog.com/2025/04/whats-new-in-jetpack-compose-april-25.html). I encountered the following issues and have documented their resolutions below: **Could not get unknown property 'keepUnusedLibraries'** After updating the version-catalog-update-plugin from 0.8.5 to 1.0.0 I received the following error: ``` Could not get unknown property 'keepUnusedLibraries' for extension 'versionCatalogUpdate' property 'keep' of type nl.littlerobots.vcu.plugin.KeepConfiguration. ``` Cause: The plugin no longer supports various `keep` properties. Fix: Remove the unsupported `keep` properties from the build config. More info: [here](littlerobots/version-catalog-update-plugin@787b856#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5L27-L215 ) and [here](https://github.com/littlerobots/version-catalog-update-plugin/blob/main/CHANGELOG.md#resolving-dependencies) **Minimum supported Gradle version is 8.11.1. Current version is 8.10.2.** Fix: Search and replace `gradle-8.10.2-bin.zip` with `gradle-8.13-bin.zip` throughout repo **Suspend function 'suspend fun navigateBack(backNavigationBehavior: BackNavigationBehavior): Boolean' can only be called from a coroutine or another suspend function.** Full error: ``` e: file:///Users/donturner/Code/workspace-android/compose-samples/Jetcaster/mobile/src/main/java/com/example/jetcaster/ui/home/Home.kt:268:19 Suspend function 'suspend fun navigateBack(backNavigationBehavior: BackNavigationBehavior): Boolean' can only be called from a coroutine or another suspend function. ``` Root cause: `ThreePaneScaffoldNavigator.navigateBack` [became a suspend fun](https://developer.android.com/jetpack/androidx/releases/compose-material3-adaptive#1.1.0-alpha04). Fix: Wrap `navigate` calls in `coroutineScope.launch` **Unresolved reference ThreePaneScaffoldNavigator.currentDestination.content** Cause: Property name changed from `content` to `contentKey` Fix: Change to `contentKey` **Core library desugaring runtime library version 1.2.2 does not support compileSdk=35 or later; please upgrade to version 2.1.5** Fix: Update jdkDesugar to 2.1.5 **Failed to apply plugin 'com.diffplug.spotless'.** Cause: `scripts/verify_samples.sh` still assumed that the spotless config would be in a separate init file, but no longer does following [this PR](#1549). Fix: Update `scripts/verify_samples.sh` to use the `spotlessCheck` task from each app's `build.gradle.kts`. **Spotless formatting issues** `Home.kt` from Jetcaster had formatting issues. Running `spotlessApply` fixes the issues but also changes code that isn't directly related to the version updates and makes reviewing difficult. For the purposes of reviewing, the original changes are [in this commit](52154e0#diff-419acc413220ab5d19bee9df1ca6b8c76d269287edf45c2895759df050d1e05a).
2 parents 2995c79 + f01276b commit e472f98

23 files changed

+171
-187
lines changed

JetLagged/buildscripts/toml-updater-config.gradle

-4
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@ versionCatalogUpdate {
1919
keep {
2020
// keep versions without any library or plugin reference
2121
keepUnusedVersions.set(true)
22-
// keep all libraries that aren't used in the project
23-
keepUnusedLibraries.set(true)
24-
// keep all plugins that aren't used in the project
25-
keepUnusedPlugins.set(true)
2622
}
2723
}
2824

JetLagged/gradle/libs.versions.toml

+17-16
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,20 @@
33
# Do not add a dependency to an individual sample, edit the global version instead.
44
#####
55
[versions]
6-
accompanist = "0.37.0"
7-
androidGradlePlugin = "8.8.1"
8-
androidx-activity-compose = "1.10.0"
6+
accompanist = "0.37.2"
7+
android-material3 = "1.13.0-alpha13"
8+
androidGradlePlugin = "8.9.2"
9+
androidx-activity-compose = "1.10.1"
910
androidx-appcompat = "1.7.0"
10-
androidx-compose-bom = "2025.02.00"
11+
androidx-compose-bom = "2025.04.01"
1112
androidx-constraintlayout = "1.1.0"
1213
androidx-core-splashscreen = "1.0.1"
13-
androidx-corektx = "1.15.0"
14+
androidx-corektx = "1.16.0"
1415
androidx-glance = "1.1.1"
1516
androidx-lifecycle = "2.8.2"
1617
androidx-lifecycle-compose = "2.8.7"
1718
androidx-lifecycle-runtime-compose = "2.8.7"
18-
androidx-navigation = "2.8.7"
19+
androidx-navigation = "2.8.9"
1920
androidx-palette = "1.0.0"
2021
androidx-test = "1.6.1"
2122
androidx-test-espresso = "3.6.1"
@@ -30,37 +31,37 @@ androix-test-uiautomator = "2.3.0"
3031
coil = "2.7.0"
3132
# @keep
3233
compileSdk = "35"
33-
coroutines = "1.10.1"
34+
coroutines = "1.10.2"
3435
google-maps = "18.2.0"
3536
gradle-versions = "0.52.0"
36-
hilt = "2.55"
37+
hilt = "2.56.2"
3738
hiltExt = "1.2.0"
38-
horologist = "0.6.22"
39-
# @pin When updating to AGP 7.4.0-alpha10 and up we can update this https://developer.android.com/studio/write/java8-support#library-desugaring-versions
40-
jdkDesugar = "1.2.2"
39+
horologist = "0.6.23"
40+
jdkDesugar = "2.1.5"
4141
junit = "4.13.2"
42-
kotlin = "2.1.10"
42+
kotlin = "2.1.20"
4343
kotlinx-serialization-json = "1.7.3"
4444
kotlinx_immutable = "0.3.8"
45-
ksp = "2.1.10-1.0.30"
45+
ksp = "2.1.20-2.0.0"
4646
maps-compose = "3.1.1"
4747
# @keep
4848
minSdk = "21"
4949
okhttp = "4.12.0"
5050
play-services-wearable = "18.1.0"
5151
robolectric = "4.14.1"
52-
roborazzi = "1.42.0"
52+
roborazzi = "1.43.1"
5353
rome = "2.1.0"
54-
room = "2.6.1"
54+
room = "2.7.1"
5555
secrets = "2.0.1"
5656
spotless = "7.0.3"
5757
# @keep
5858
targetSdk = "33"
59-
version-catalog-update = "0.8.5"
59+
version-catalog-update = "1.0.0"
6060

6161
[libraries]
6262
accompanist-adaptive = { module = "com.google.accompanist:accompanist-adaptive", version.ref = "accompanist" }
6363
accompanist-permissions = { module = "com.google.accompanist:accompanist-permissions", version.ref = "accompanist" }
64+
android-material3 = { module = "com.google.android.material:material", version.ref = "android-material3" }
6465
androidx-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "androidx-activity-compose" }
6566
androidx-activity-ktx = { module = "androidx.activity:activity-ktx", version.ref = "androidx-activity-compose" }
6667
androidx-appcompat = { module = "androidx.appcompat:appcompat", version.ref = "androidx-appcompat" }

JetLagged/gradle/wrapper/gradle-wrapper.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@
1414

1515
distributionBase=GRADLE_USER_HOME
1616
distributionPath=wrapper/dists
17-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
17+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
1818
zipStoreBase=GRADLE_USER_HOME
1919
zipStorePath=wrapper/dists

JetNews/buildscripts/toml-updater-config.gradle

-4
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@ versionCatalogUpdate {
1919
keep {
2020
// keep versions without any library or plugin reference
2121
keepUnusedVersions.set(true)
22-
// keep all libraries that aren't used in the project
23-
keepUnusedLibraries.set(true)
24-
// keep all plugins that aren't used in the project
25-
keepUnusedPlugins.set(true)
2622
}
2723
}
2824

JetNews/gradle/libs.versions.toml

+17-16
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,20 @@
33
# Do not add a dependency to an individual sample, edit the global version instead.
44
#####
55
[versions]
6-
accompanist = "0.37.0"
7-
androidGradlePlugin = "8.8.1"
8-
androidx-activity-compose = "1.10.0"
6+
accompanist = "0.37.2"
7+
android-material3 = "1.13.0-alpha13"
8+
androidGradlePlugin = "8.9.2"
9+
androidx-activity-compose = "1.10.1"
910
androidx-appcompat = "1.7.0"
10-
androidx-compose-bom = "2025.02.00"
11+
androidx-compose-bom = "2025.04.01"
1112
androidx-constraintlayout = "1.1.0"
1213
androidx-core-splashscreen = "1.0.1"
13-
androidx-corektx = "1.15.0"
14+
androidx-corektx = "1.16.0"
1415
androidx-glance = "1.1.1"
1516
androidx-lifecycle = "2.8.2"
1617
androidx-lifecycle-compose = "2.8.7"
1718
androidx-lifecycle-runtime-compose = "2.8.7"
18-
androidx-navigation = "2.8.7"
19+
androidx-navigation = "2.8.9"
1920
androidx-palette = "1.0.0"
2021
androidx-test = "1.6.1"
2122
androidx-test-espresso = "3.6.1"
@@ -30,37 +31,37 @@ androix-test-uiautomator = "2.3.0"
3031
coil = "2.7.0"
3132
# @keep
3233
compileSdk = "35"
33-
coroutines = "1.10.1"
34+
coroutines = "1.10.2"
3435
google-maps = "18.2.0"
3536
gradle-versions = "0.52.0"
36-
hilt = "2.55"
37+
hilt = "2.56.2"
3738
hiltExt = "1.2.0"
38-
horologist = "0.6.22"
39-
# @pin When updating to AGP 7.4.0-alpha10 and up we can update this https://developer.android.com/studio/write/java8-support#library-desugaring-versions
40-
jdkDesugar = "1.2.2"
39+
horologist = "0.6.23"
40+
jdkDesugar = "2.1.5"
4141
junit = "4.13.2"
42-
kotlin = "2.1.10"
42+
kotlin = "2.1.20"
4343
kotlinx-serialization-json = "1.7.3"
4444
kotlinx_immutable = "0.3.8"
45-
ksp = "2.1.10-1.0.30"
45+
ksp = "2.1.20-2.0.0"
4646
maps-compose = "3.1.1"
4747
# @keep
4848
minSdk = "21"
4949
okhttp = "4.12.0"
5050
play-services-wearable = "18.1.0"
5151
robolectric = "4.14.1"
52-
roborazzi = "1.42.0"
52+
roborazzi = "1.43.1"
5353
rome = "2.1.0"
54-
room = "2.6.1"
54+
room = "2.7.1"
5555
secrets = "2.0.1"
5656
spotless = "7.0.3"
5757
# @keep
5858
targetSdk = "33"
59-
version-catalog-update = "0.8.5"
59+
version-catalog-update = "1.0.0"
6060

6161
[libraries]
6262
accompanist-adaptive = { module = "com.google.accompanist:accompanist-adaptive", version.ref = "accompanist" }
6363
accompanist-permissions = { module = "com.google.accompanist:accompanist-permissions", version.ref = "accompanist" }
64+
android-material3 = { module = "com.google.android.material:material", version.ref = "android-material3" }
6465
androidx-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "androidx-activity-compose" }
6566
androidx-activity-ktx = { module = "androidx.activity:activity-ktx", version.ref = "androidx-activity-compose" }
6667
androidx-appcompat = { module = "androidx.appcompat:appcompat", version.ref = "androidx-appcompat" }

JetNews/gradle/wrapper/gradle-wrapper.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@
1414

1515
distributionBase=GRADLE_USER_HOME
1616
distributionPath=wrapper/dists
17-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
17+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
1818
zipStoreBase=GRADLE_USER_HOME
1919
zipStorePath=wrapper/dists

Jetcaster/buildscripts/toml-updater-config.gradle

-4
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@ versionCatalogUpdate {
1919
keep {
2020
// keep versions without any library or plugin reference
2121
keepUnusedVersions.set(true)
22-
// keep all libraries that aren't used in the project
23-
keepUnusedLibraries.set(true)
24-
// keep all plugins that aren't used in the project
25-
keepUnusedPlugins.set(true)
2622
}
2723
}
2824

Jetcaster/gradle/libs.versions.toml

+17-18
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,20 @@
33
# Do not add a dependency to an individual sample, edit the global version instead.
44
#####
55
[versions]
6-
accompanist = "0.37.0"
7-
androidGradlePlugin = "8.8.1"
8-
androidx-activity-compose = "1.10.0"
6+
accompanist = "0.37.2"
7+
android-material3 = "1.13.0-alpha13"
8+
androidGradlePlugin = "8.9.2"
9+
androidx-activity-compose = "1.10.1"
910
androidx-appcompat = "1.7.0"
10-
androidx-compose-bom = "2025.02.00"
11+
androidx-compose-bom = "2025.04.01"
1112
androidx-constraintlayout = "1.1.0"
1213
androidx-core-splashscreen = "1.0.1"
13-
androidx-corektx = "1.15.0"
14+
androidx-corektx = "1.16.0"
1415
androidx-glance = "1.1.1"
1516
androidx-lifecycle = "2.8.2"
1617
androidx-lifecycle-compose = "2.8.7"
1718
androidx-lifecycle-runtime-compose = "2.8.7"
18-
android-material3 = "1.13.0-alpha11"
19-
androidx-navigation = "2.8.7"
19+
androidx-navigation = "2.8.9"
2020
androidx-palette = "1.0.0"
2121
androidx-test = "1.6.1"
2222
androidx-test-espresso = "3.6.1"
@@ -31,37 +31,37 @@ androix-test-uiautomator = "2.3.0"
3131
coil = "2.7.0"
3232
# @keep
3333
compileSdk = "35"
34-
coroutines = "1.10.1"
34+
coroutines = "1.10.2"
3535
google-maps = "18.2.0"
3636
gradle-versions = "0.52.0"
37-
hilt = "2.55"
37+
hilt = "2.56.2"
3838
hiltExt = "1.2.0"
39-
horologist = "0.6.22"
40-
# @pin When updating to AGP 7.4.0-alpha10 and up we can update this https://developer.android.com/studio/write/java8-support#library-desugaring-versions
41-
jdkDesugar = "1.2.2"
39+
horologist = "0.6.23"
40+
jdkDesugar = "2.1.5"
4241
junit = "4.13.2"
43-
kotlin = "2.1.10"
42+
kotlin = "2.1.20"
4443
kotlinx-serialization-json = "1.7.3"
4544
kotlinx_immutable = "0.3.8"
46-
ksp = "2.1.10-1.0.30"
45+
ksp = "2.1.20-2.0.0"
4746
maps-compose = "3.1.1"
4847
# @keep
4948
minSdk = "21"
5049
okhttp = "4.12.0"
5150
play-services-wearable = "18.1.0"
5251
robolectric = "4.14.1"
53-
roborazzi = "1.42.0"
52+
roborazzi = "1.43.1"
5453
rome = "2.1.0"
55-
room = "2.6.1"
54+
room = "2.7.1"
5655
secrets = "2.0.1"
5756
spotless = "7.0.3"
5857
# @keep
5958
targetSdk = "33"
60-
version-catalog-update = "0.8.5"
59+
version-catalog-update = "1.0.0"
6160

6261
[libraries]
6362
accompanist-adaptive = { module = "com.google.accompanist:accompanist-adaptive", version.ref = "accompanist" }
6463
accompanist-permissions = { module = "com.google.accompanist:accompanist-permissions", version.ref = "accompanist" }
64+
android-material3 = { module = "com.google.android.material:material", version.ref = "android-material3" }
6565
androidx-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "androidx-activity-compose" }
6666
androidx-activity-ktx = { module = "androidx.activity:activity-ktx", version.ref = "androidx-activity-compose" }
6767
androidx-appcompat = { module = "androidx.appcompat:appcompat", version.ref = "androidx-appcompat" }
@@ -149,7 +149,6 @@ kotlinx-collections-immutable = { module = "org.jetbrains.kotlinx:kotlinx-collec
149149
kotlinx-coroutines-android = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-android", version.ref = "coroutines" }
150150
kotlinx-coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "coroutines" }
151151
kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kotlinx-serialization-json" }
152-
android-material3 = { group = "com.google.android.material", name = "material", version.ref = "android-material3" }
153152
okhttp-logging = { module = "com.squareup.okhttp3:logging-interceptor", version.ref = "okhttp" }
154153
okhttp3 = { module = "com.squareup.okhttp3:okhttp", version.ref = "okhttp" }
155154
play-services-wearable = { module = "com.google.android.gms:play-services-wearable", version.ref = "play-services-wearable" }

Jetcaster/gradle/wrapper/gradle-wrapper.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@
1414

1515
distributionBase=GRADLE_USER_HOME
1616
distributionPath=wrapper/dists
17-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
17+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
1818
zipStoreBase=GRADLE_USER_HOME
1919
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)