diff --git a/bluetoothle/build.gradle.kts b/bluetoothle/build.gradle.kts index 5dafe1346..11ce58f15 100644 --- a/bluetoothle/build.gradle.kts +++ b/bluetoothle/build.gradle.kts @@ -2,6 +2,11 @@ plugins { alias(libs.plugins.android.application) } + +kotlin { + jvmToolchain(17) +} + android { compileSdk = libs.versions.compileSdk.get().toInt() namespace = "com.sample.android.bluetoothle" @@ -18,9 +23,6 @@ android { sourceCompatibility = JavaVersion.VERSION_17 targetCompatibility = JavaVersion.VERSION_17 } - kotlin { - jvmToolchain(17) - } buildTypes { getByName("debug") { signingConfig = signingConfigs.getByName("debug") diff --git a/camerax/build.gradle.kts b/camerax/build.gradle.kts index 14985c6e3..c27ca6ff3 100644 --- a/camerax/build.gradle.kts +++ b/camerax/build.gradle.kts @@ -21,6 +21,12 @@ plugins { alias(libs.plugins.compose.compiler) } +kotlin { + compilerOptions { + jvmTarget = JvmTarget.fromTarget("17") + } +} + android { namespace = "com.example.camerax.snippets" compileSdk = 36 @@ -48,11 +54,6 @@ android { sourceCompatibility = JavaVersion.VERSION_17 targetCompatibility = JavaVersion.VERSION_17 } - kotlin { - compilerOptions { - jvmTarget = JvmTarget.fromTarget("17") - } - } buildFeatures { compose = true } diff --git a/compose/snippets/build.gradle.kts b/compose/snippets/build.gradle.kts index d09615d7d..728870a95 100644 --- a/compose/snippets/build.gradle.kts +++ b/compose/snippets/build.gradle.kts @@ -23,6 +23,10 @@ plugins { alias(libs.plugins.kotlin.serialization) } +kotlin { + jvmToolchain(17) +} + android { compileSdk = libs.versions.compileSdk.get().toInt() namespace = "com.example.compose.snippets" @@ -43,6 +47,7 @@ android { getByName("release") { isMinifyEnabled = true + isShrinkResources = true proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro") } @@ -53,10 +58,6 @@ android { targetCompatibility = JavaVersion.VERSION_17 } - kotlin { - jvmToolchain(17) - } - buildFeatures { compose = true // Disable unused AGP features diff --git a/compose/snippets/src/androidTest/java/com/example/compose/snippets/accessibility/AccessibilitySnippets.kt b/compose/snippets/src/androidTest/java/com/example/compose/snippets/accessibility/AccessibilitySnippets.kt index ee6b51325..64adbf4e0 100644 --- a/compose/snippets/src/androidTest/java/com/example/compose/snippets/accessibility/AccessibilitySnippets.kt +++ b/compose/snippets/src/androidTest/java/com/example/compose/snippets/accessibility/AccessibilitySnippets.kt @@ -33,7 +33,7 @@ import androidx.compose.ui.semantics.semantics import androidx.compose.ui.test.SemanticsMatcher import androidx.compose.ui.test.assert import androidx.compose.ui.test.junit4.accessibility.enableAccessibilityChecks -import androidx.compose.ui.test.junit4.createAndroidComposeRule +import androidx.compose.ui.test.junit4.v2.createAndroidComposeRule import androidx.compose.ui.test.onRoot import androidx.compose.ui.test.tryPerformAccessibilityChecks import androidx.compose.ui.unit.dp diff --git a/compose/snippets/src/androidTest/java/com/example/compose/snippets/animation/AnimationTestingSnippets.kt b/compose/snippets/src/androidTest/java/com/example/compose/snippets/animation/AnimationTestingSnippets.kt index 2241a2e8d..540f5b22b 100644 --- a/compose/snippets/src/androidTest/java/com/example/compose/snippets/animation/AnimationTestingSnippets.kt +++ b/compose/snippets/src/androidTest/java/com/example/compose/snippets/animation/AnimationTestingSnippets.kt @@ -30,7 +30,7 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.ImageBitmap import androidx.compose.ui.test.captureToImage -import androidx.compose.ui.test.junit4.createComposeRule +import androidx.compose.ui.test.junit4.v2.createComposeRule import androidx.compose.ui.test.onRoot import androidx.compose.ui.unit.dp import org.junit.Rule diff --git a/compose/snippets/src/androidTest/java/com/example/compose/snippets/deviceconfigurationoverride/DeviceConfigurationOverrideSnippets.kt b/compose/snippets/src/androidTest/java/com/example/compose/snippets/deviceconfigurationoverride/DeviceConfigurationOverrideSnippets.kt index fca68ad4f..9495a83c4 100644 --- a/compose/snippets/src/androidTest/java/com/example/compose/snippets/deviceconfigurationoverride/DeviceConfigurationOverrideSnippets.kt +++ b/compose/snippets/src/androidTest/java/com/example/compose/snippets/deviceconfigurationoverride/DeviceConfigurationOverrideSnippets.kt @@ -21,7 +21,7 @@ import androidx.compose.ui.test.DeviceConfigurationOverride import androidx.compose.ui.test.FontScale import androidx.compose.ui.test.FontWeightAdjustment import androidx.compose.ui.test.ForcedSize -import androidx.compose.ui.test.junit4.createComposeRule +import androidx.compose.ui.test.junit4.v2.createComposeRule import androidx.compose.ui.test.then import androidx.compose.ui.unit.DpSize import androidx.compose.ui.unit.dp diff --git a/compose/snippets/src/androidTest/java/com/example/compose/snippets/interop/AddingComposeToYourAppSnippets.kt b/compose/snippets/src/androidTest/java/com/example/compose/snippets/interop/AddingComposeToYourAppSnippets.kt index 726b7794d..18e4b6e6a 100644 --- a/compose/snippets/src/androidTest/java/com/example/compose/snippets/interop/AddingComposeToYourAppSnippets.kt +++ b/compose/snippets/src/androidTest/java/com/example/compose/snippets/interop/AddingComposeToYourAppSnippets.kt @@ -17,7 +17,7 @@ package com.example.compose.snippets.interop import androidx.compose.ui.test.assertIsDisplayed -import androidx.compose.ui.test.junit4.createAndroidComposeRule +import androidx.compose.ui.test.junit4.v2.createAndroidComposeRule import androidx.compose.ui.test.onNodeWithText import androidx.test.platform.app.InstrumentationRegistry import com.example.compose.snippets.MyActivity diff --git a/compose/snippets/src/androidTest/java/com/example/compose/snippets/semantics/SemanticsSnippets.kt b/compose/snippets/src/androidTest/java/com/example/compose/snippets/semantics/SemanticsSnippets.kt index 89b577ea7..2f2669168 100644 --- a/compose/snippets/src/androidTest/java/com/example/compose/snippets/semantics/SemanticsSnippets.kt +++ b/compose/snippets/src/androidTest/java/com/example/compose/snippets/semantics/SemanticsSnippets.kt @@ -22,7 +22,7 @@ import androidx.compose.ui.semantics.Role import androidx.compose.ui.semantics.SemanticsProperties import androidx.compose.ui.test.SemanticsMatcher import androidx.compose.ui.test.assertIsOff -import androidx.compose.ui.test.junit4.createComposeRule +import androidx.compose.ui.test.junit4.v2.createComposeRule import androidx.compose.ui.test.onNodeWithText import androidx.compose.ui.test.onRoot import androidx.compose.ui.test.performClick diff --git a/compose/snippets/src/androidTest/java/com/example/compose/snippets/touchinput/pointerinput/UnderstandGesturesSnippets.kt b/compose/snippets/src/androidTest/java/com/example/compose/snippets/touchinput/pointerinput/UnderstandGesturesSnippets.kt index 4b204b232..dddf65e35 100644 --- a/compose/snippets/src/androidTest/java/com/example/compose/snippets/touchinput/pointerinput/UnderstandGesturesSnippets.kt +++ b/compose/snippets/src/androidTest/java/com/example/compose/snippets/touchinput/pointerinput/UnderstandGesturesSnippets.kt @@ -19,7 +19,7 @@ package com.example.compose.snippets.touchinput.pointerinput import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.ui.test.click -import androidx.compose.ui.test.junit4.createComposeRule +import androidx.compose.ui.test.junit4.v2.createComposeRule import androidx.compose.ui.test.onNodeWithTag import androidx.compose.ui.test.performTouchInput import androidx.compose.ui.test.swipeDown diff --git a/compose/snippets/src/main/java/com/example/compose/snippets/components/DatePickers.kt b/compose/snippets/src/main/java/com/example/compose/snippets/components/DatePickers.kt index 4d59ea4ef..f5dca89af 100644 --- a/compose/snippets/src/main/java/com/example/compose/snippets/components/DatePickers.kt +++ b/compose/snippets/src/main/java/com/example/compose/snippets/components/DatePickers.kt @@ -61,6 +61,7 @@ import com.example.compose.snippets.ui.theme.SnippetsTheme import java.text.SimpleDateFormat import java.util.Date import java.util.Locale +import androidx.compose.ui.platform.LocalLocale @Preview @Composable @@ -105,7 +106,7 @@ fun DatePickerExamples() { // [END_EXCLUDE] if (selectedDate != null) { val date = Date(selectedDate!!) - val formattedDate = SimpleDateFormat("MMM dd, yyyy", Locale.getDefault()).format(date) + val formattedDate = SimpleDateFormat("MMM dd, yyyy", LocalLocale.current.platformLocale).format(date) Text("Selected date: $formattedDate") } else { Text("No date selected") @@ -121,8 +122,8 @@ fun DatePickerExamples() { if (selectedDateRange.first != null && selectedDateRange.second != null) { val startDate = Date(selectedDateRange.first!!) val endDate = Date(selectedDateRange.second!!) - val formattedStartDate = SimpleDateFormat("MMM dd, yyyy", Locale.getDefault()).format(startDate) - val formattedEndDate = SimpleDateFormat("MMM dd, yyyy", Locale.getDefault()).format(endDate) + val formattedStartDate = SimpleDateFormat("MMM dd, yyyy", LocalLocale.current.platformLocale).format(startDate) + val formattedEndDate = SimpleDateFormat("MMM dd, yyyy", LocalLocale.current.platformLocale).format(endDate) Text("Selected date range: $formattedStartDate - $formattedEndDate") } else { Text("No date range selected") diff --git a/datastore/build.gradle.kts b/datastore/build.gradle.kts index e8364bd97..0ad5e2f93 100644 --- a/datastore/build.gradle.kts +++ b/datastore/build.gradle.kts @@ -12,6 +12,12 @@ plugins { // [END android_datastore_serialization_plugin] } +kotlin { + compilerOptions { + jvmTarget = JvmTarget.fromTarget("11") + } +} + android { namespace = "com.example.datastore.snippets" compileSdk = 36 @@ -39,11 +45,6 @@ android { sourceCompatibility = JavaVersion.VERSION_11 targetCompatibility = JavaVersion.VERSION_11 } - kotlin { - compilerOptions { - jvmTarget = JvmTarget.fromTarget("11") - } - } buildFeatures { compose = true } diff --git a/datastore/src/androidTest/java/com/example/datastore/snippets/DataStoreSnippetsTest.kt b/datastore/src/androidTest/java/com/example/datastore/snippets/DataStoreSnippetsTest.kt index 6163fe03e..c37a77353 100644 --- a/datastore/src/androidTest/java/com/example/datastore/snippets/DataStoreSnippetsTest.kt +++ b/datastore/src/androidTest/java/com/example/datastore/snippets/DataStoreSnippetsTest.kt @@ -16,7 +16,7 @@ package com.example.datastore.snippets -import androidx.compose.ui.test.junit4.createComposeRule +import androidx.compose.ui.test.junit4.v2.createComposeRule import androidx.compose.ui.test.onNodeWithText import androidx.test.ext.junit.runners.AndroidJUnit4 import com.example.datastore.snippets.json.JsonDataStoreScreen diff --git a/gradle.properties b/gradle.properties index 64bd410cc..0346ade7c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -24,7 +24,6 @@ kotlin.code.style=official # Enable R8 full mode. android.enableR8.fullMode=true -android.newDsl=false # Use an AndroidX snapshot build. # https://androidx.dev/snapshots/builds -# snapshotVersion=14793336 \ No newline at end of file +# snapshotVersion=14793336 diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 3bd830def..43c3f9ce5 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -8,9 +8,9 @@ androidx-appcompat = "1.7.1" androidx-appfunctions = "1.0.0-alpha08" androidx-cameraX = "1.6.0" androidx-car = "1.7.0" -androidx-compose-bom = "2026.03.00" +androidx-compose-bom = "2026.05.00" androidx-compose-ui-test = "1.7.0-alpha08" -androidx-compose-ui-test-junit4-accessibility = "1.11.0-beta01" +androidx-compose-ui-test-junit4-accessibility = "1.11.1" androidx-constraintlayout = "2.2.1" androidx-constraintlayout-compose = "1.1.1" androidx-coordinator-layout = "1.3.0" @@ -24,9 +24,10 @@ androidx-glance-appwidget = "1.1.1" androidx-lifecycle-compose = "2.10.0" androidx-lifecycle-runtime-compose = "2.10.0" androidx-lifecycle-viewmodel-navigation3 = "2.10.0-beta01" -androidx-navigation = "2.9.7" +androidx-navigation = "2.9.8" androidx-navigation3 = "1.1.0" -androidx-paging = "3.4.2" +androidx-paging = "3.5.0" + androidx-startup-runtime = "1.2.0" androidx-test = "1.7.0" androidx-test-core-ktx = "1.6.1" @@ -41,8 +42,8 @@ appcompat = "1.7.1" coil = "2.7.0" # @keep compileSdk = "37" -compose-latest = "1.10.5" -composeUiTooling = "1.5.6" +compose-latest = "1.11.1" +composeUiTooling = "1.6.1" coreSplashscreen = "1.2.0" coroutines = "1.10.2" crossdeviceprompt = "0.0.1" @@ -51,64 +52,64 @@ datastoreCore = "1.2.1" datastorePreferencesRxjava2 = "1.2.1" datastorePreferencesRxjava3 = "1.2.1" firebase-bom = "34.10.0" -glide = "1.0.0-beta08" +glide = "1.0.0-beta09" google-ar-core = "1.53.0" google-maps = "20.0.0" -gradle-versions = "0.53.0" -guava = "33.5.0-jre" -guava-android = "33.5.0-jre" +gradle-versions = "0.54.0" +guava = "33.6.0-jre" +guava-android = "33.6.0-jre" health-connect = "1.1.0-alpha11" hilt = "2.59.2" horologist = "0.8.3-alpha" junit = "4.13.2" -kotlin = "2.3.10" +kotlin = "2.3.21" kotlinCoroutinesOkhttp = "1.0" kotlinxCoroutinesGuava = "1.10.2" -kotlinxSerialization = "1.10.0" -ksp = "2.3.6" +kotlinxSerialization = "1.11.0" +ksp = "2.3.7" ktlint = "1.5.0" lifecycleService = "2.10.0" -maps-compose = "8.2.1" -material = "1.14.0-alpha10" +maps-compose = "8.3.0" +material = "1.14.0-beta01" material3-adaptive = "1.2.0" material3-adaptive-navigation-suite = "1.4.0" material3-adaptive-navigation3 = "1.3.0-alpha09" -media3 = "1.9.2" -media3Ui = "1.9.2" +media3 = "1.10.0" +media3Ui = "1.10.0" mockitoKotlin = "5.3.1" # @keep minSdk = "36" okHttp = "5.3.2" playServicesWearable = "19.0.0" playbilling = "8.3.0" -protobuf = "4.34.0" -protoc = "0.9.6" -protolayout = "1.3.0" +protobuf = "4.34.1" +protoc = "0.10.0" +protolayout = "1.4.0" reactive-streams = "1.0.4" recyclerview = "1.4.0" registryDigitalCredentials = "1.0.0-alpha04" robolectric = "4.16.1" roborazzi = "1.59.0" -spotless = "8.3.0" +spotless = "8.4.0" targetSdk = "37" -tiles = "1.5.0" +tiles = "1.6.0" tracing = "1.3.0" -truth = "1.4.4" -tvComposeMaterial3 = "1.1.0-beta01" +truth = "1.4.5" +tvComposeMaterial3 = "1.1.0" validatorPush = "1.0.0-alpha09" version-catalog-update = "1.1.0" watchfaceComplicationsDataSourceKtx = "1.3.0" wear = "1.4.0" -wearComposeFoundation = "1.6.0-rc01" -wearComposeMaterial = "1.6.0-rc01" -wearComposeMaterial3 = "1.6.0-rc01" +wearComposeFoundation = "1.6.1" +wearComposeMaterial = "1.6.1" +wearComposeMaterial3 = "1.6.1" wearInput = "1.2.0" wearOngoing = "1.1.0" wearPhoneInteractions = "1.1.0" wearRemoteInteractions = "1.2.0" wearToolingPreview = "1.0.0" webkit = "1.15.0" -wfp = "1.0.0-rc01" +wfp = "1.0.0" androidx-core-telecom = "1.1.0-alpha04" media3Session = "1.10.0" playServicesFitness = "21.3.0" diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index dbc3ce4a0..c61a118f7 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.0-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.1-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/identity/credentialmanager/build.gradle.kts b/identity/credentialmanager/build.gradle.kts index 1db987788..64b79e8d7 100644 --- a/identity/credentialmanager/build.gradle.kts +++ b/identity/credentialmanager/build.gradle.kts @@ -1,4 +1,3 @@ -import org.jetbrains.kotlin.gradle.dsl.JvmTarget plugins { alias(libs.plugins.android.application) alias(libs.plugins.compose.compiler) @@ -34,13 +33,6 @@ android { buildFeatures { compose = true } - sourceSets { - named("main") { - java { - srcDir("src/main/java") - } - } - } } dependencies { diff --git a/kmp/shared/build.gradle.kts b/kmp/shared/build.gradle.kts index 2ef25a933..d0683b1f4 100644 --- a/kmp/shared/build.gradle.kts +++ b/kmp/shared/build.gradle.kts @@ -8,7 +8,7 @@ kotlin { // Target declarations - add or remove as needed below. These define // which platforms this KMP module supports. // See: https://kotlinlang.org/docs/multiplatform-discover-project.html#targets - androidLibrary { + android { namespace = "com.example.kmp.snippets.shared" compileSdk = libs.versions.compileSdk.get().toInt() minSdk = libs.versions.minSdk.get().toInt() diff --git a/kotlin/build.gradle.kts b/kotlin/build.gradle.kts index c290346fc..c9bdb6eb0 100644 --- a/kotlin/build.gradle.kts +++ b/kotlin/build.gradle.kts @@ -2,6 +2,10 @@ plugins { alias(libs.plugins.android.application) } +kotlin { + jvmToolchain(17) +} + android { compileSdk = libs.versions.compileSdk.get().toInt() namespace = "com.example.android.kotlin" @@ -15,10 +19,6 @@ android { testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" } - kotlin { - jvmToolchain(17) - } - buildTypes { getByName("debug") { signingConfig = signingConfigs.getByName("debug") @@ -40,7 +40,6 @@ android { // Disable unused AGP features buildConfig = false aidl = false - renderScript = false resValues = false shaders = false } diff --git a/watchfacepush/validator/build.gradle.kts b/watchfacepush/validator/build.gradle.kts index 7cfb5372d..3e0d6c20d 100644 --- a/watchfacepush/validator/build.gradle.kts +++ b/watchfacepush/validator/build.gradle.kts @@ -37,15 +37,6 @@ application { } -sourceSets { - named("main") { - java { - srcDir("src/main/java") - } - } - -} - dependencies { implementation(libs.validator.push) } diff --git a/wear/build.gradle.kts b/wear/build.gradle.kts index a382d6023..5b3465d76 100644 --- a/wear/build.gradle.kts +++ b/wear/build.gradle.kts @@ -6,6 +6,13 @@ plugins { alias(libs.plugins.roborazzi) } +kotlin { + jvmToolchain(21) + compilerOptions { + jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_21) + } +} + android { namespace = "com.example.wear" compileSdk = 36 @@ -35,12 +42,6 @@ android { sourceCompatibility = JavaVersion.VERSION_21 targetCompatibility = JavaVersion.VERSION_21 } - kotlin { - jvmToolchain(21) - compilerOptions { - jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_21) - } - } buildFeatures { compose = true