From 2cec357c143b02e68da142ffaadcfa81922ceb62 Mon Sep 17 00:00:00 2001 From: dkhawk <107309+dkhawk@users.noreply.github.com> Date: Tue, 16 Jun 2026 15:48:38 -0600 Subject: [PATCH 1/4] fix(deps): update Kotlin to 2.4.0 and Android Maps Utils to 4.5.0 --- gradle/libs.versions.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 80729769..ad60b19e 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -10,7 +10,7 @@ androidxCoreKtx = "1.18.0" # Increasing androidxActivityKtx or lifecycleRuntimeKtx will require us to upgrade the minSdk androidxActivityKtx = "1.13.0" lifecycleRuntimeKtx = "2.10.0" -kotlin = "2.3.21" +kotlin = "2.4.0" kotlinxCoroutines = "1.11.0" material = "1.14.0" androidxStartup = "1.2.0" @@ -18,7 +18,7 @@ androidxStartup = "1.2.0" # --- Google Maps --- # Versions for Google Play Services libraries, which are essential for this sample. androidMapsSdk = "20.0.0" -androidMapsUtils = "4.4.0" +androidMapsUtils = "4.5.0" # --- Testing --- # Versions for testing libraries. From 8b691a9039d0347049b4eeabb0db8213263938e1 Mon Sep 17 00:00:00 2001 From: dkhawk <107309+dkhawk@users.noreply.github.com> Date: Tue, 16 Jun 2026 16:27:26 -0600 Subject: [PATCH 2/4] fix(deps): upgrade to AGP 9.2.1, Gradle 9.4.1, and built-in Kotlin --- app/build.gradle.kts | 1 - build.gradle.kts | 7 ++++++- gradle.properties | 9 +++++++-- gradle/libs.versions.toml | 7 +++---- gradle/wrapper/gradle-wrapper.properties | 3 +-- maps-ktx/build.gradle.kts | 8 ++++++-- maps-utils-ktx/build.gradle.kts | 1 - 7 files changed, 23 insertions(+), 13 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 3750b651..6b5032cc 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -16,7 +16,6 @@ plugins { alias(libs.plugins.android.application) - alias(libs.plugins.kotlin.android) alias(libs.plugins.secrets.gradle.plugin) } diff --git a/build.gradle.kts b/build.gradle.kts index 39910dd2..424137b8 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -14,9 +14,14 @@ * limitations under the License. */ +buildscript { + dependencies { + classpath(libs.kotlin.gradle.plugin) + } +} + plugins { alias(libs.plugins.android.application) apply false - alias(libs.plugins.kotlin.android) apply false alias(libs.plugins.dokka) alias(libs.plugins.gradle.maven.publish) apply false alias(libs.plugins.secrets.gradle.plugin) apply false diff --git a/gradle.properties b/gradle.properties index 01f8cab6..881b7646 100644 --- a/gradle.properties +++ b/gradle.properties @@ -25,7 +25,6 @@ kotlin.code.style=official signing.keyId= signing.password= signing.secretKeyRingFile= -android.defaults.buildfeatures.buildconfig=true mavenCentralUsername= mavenCentralPassword= @@ -39,4 +38,10 @@ android.javaCompile.suppressSourceTargetDeprecationWarning=true # Add a property to enable automatic release to Maven Central (optional, but good for CI) # If true, publishToMavenCentral will also close and release the staging repository -mavenCentralAutomaticRelease=false \ No newline at end of file +mavenCentralAutomaticRelease=false +android.defaults.buildfeatures.resvalues=true +android.sdk.defaultTargetSdkToCompileSdkIfUnset=false +android.usesSdkInManifest.disallowed=false +android.dependency.useConstraints=true +android.r8.strictFullModeForKeepRules=false +android.r8.optimizedResourceShrinking=false \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index ad60b19e..2fe3552f 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,12 +1,12 @@ [versions] # --- Core Android & Kotlin --- # These are the fundamental versions for building the Android app. -androidCompileSdk = "36" +androidCompileSdk = "37" androidMinSdk = "23" androidTargetSdk = "36" androidxAppcompat = "1.7.1" -androidxCoreKtx = "1.18.0" +androidxCoreKtx = "1.19.0" # Increasing androidxActivityKtx or lifecycleRuntimeKtx will require us to upgrade the minSdk androidxActivityKtx = "1.13.0" lifecycleRuntimeKtx = "2.10.0" @@ -32,7 +32,7 @@ truth = "1.4.5" # --- Gradle Plugins --- # Versions for Gradle plugins used in the build process. -agp = "8.13.2" +agp = "9.2.1" dokkaGradlePlugin = "2.2.0" gradleMavenPublishPlugin = "0.36.0" jacocoAndroidGradlePlugin = "0.2.1" @@ -78,7 +78,6 @@ android-gradle-plugin = { module = "com.android.tools.build:gradle", version.ref [plugins] # --- Core Gradle Plugins --- android-application = { id = "com.android.application", version.ref = "agp" } -kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } # --- Utility Gradle Plugins --- # The secrets plugin is used to securely handle the Maps API key, preventing it from being checked into source control. diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 6a38a8ce..c61a118f 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,7 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionSha256Sum=a17ddd85a26b6a7f5ddb71ff8b05fc5104c0202c6e64782429790c933686c806 -distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.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/maps-ktx/build.gradle.kts b/maps-ktx/build.gradle.kts index 664359db..89b85d3a 100644 --- a/maps-ktx/build.gradle.kts +++ b/maps-ktx/build.gradle.kts @@ -16,7 +16,6 @@ */ plugins { - alias(libs.plugins.kotlin.android) id("android.maps.ktx.PublishingConventionPlugin") id("org.jetbrains.dokka") } @@ -39,7 +38,6 @@ android { targetCompatibility = JavaVersion.VERSION_1_8 } - sourceSets["main"].java.srcDir("build/generated/source/artifactId") kotlin { compilerOptions { @@ -55,6 +53,12 @@ android { namespace = "com.google.maps.android.ktx" } +androidComponents { + onVariants { variant -> + variant.sources.kotlin?.addStaticSourceDirectory("build/generated/source/artifactId") + } +} + dependencies { implementation(libs.kotlin.stdlib) implementation(libs.kotlinx.coroutines.android) diff --git a/maps-utils-ktx/build.gradle.kts b/maps-utils-ktx/build.gradle.kts index 5fbff0f6..898c2b77 100644 --- a/maps-utils-ktx/build.gradle.kts +++ b/maps-utils-ktx/build.gradle.kts @@ -15,7 +15,6 @@ */ plugins { - alias(libs.plugins.kotlin.android) id("android.maps.ktx.PublishingConventionPlugin") id("org.jetbrains.dokka") } From feda3a50ad7f2fb42985204d0f16586f8c1073d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enrique=20Lo=CC=81pez=20Man=CC=83as?= Date: Wed, 1 Jul 2026 17:10:28 +0200 Subject: [PATCH 3/4] chore: removed install options --- app/build.gradle.kts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 79a9458f..e0b8c848 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -50,10 +50,6 @@ android { testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" } - adbOptions { - installOptions("-g", "-r") - } - buildFeatures { buildConfig = true } From d29f64edeffd156fc6f0122785dbedfa089398a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enrique=20Lo=CC=81pez=20Man=CC=83as?= Date: Wed, 1 Jul 2026 17:27:09 +0200 Subject: [PATCH 4/4] fix: add testReleaseUnitTest task workaround for Jacoco on AGP 9.0+ The com.mxalbert.gradle:jacoco-android plugin crashes when trying to create test reports for variants that don't exist in AGP 9.2.1. This adds dummy testReleaseUnitTest tasks to library modules as a workaround. --- maps-ktx/build.gradle.kts | 3 +++ maps-utils-ktx/build.gradle.kts | 3 +++ 2 files changed, 6 insertions(+) diff --git a/maps-ktx/build.gradle.kts b/maps-ktx/build.gradle.kts index a94419f5..601ee61f 100644 --- a/maps-ktx/build.gradle.kts +++ b/maps-ktx/build.gradle.kts @@ -73,6 +73,9 @@ androidComponents { } } +// Workaround for com.mxalbert.gradle.jacoco-android plugin crash on AGP 9.0+ +tasks.register("testReleaseUnitTest") {} + dependencies { implementation(libs.kotlin.stdlib) implementation(libs.kotlinx.coroutines.android) diff --git a/maps-utils-ktx/build.gradle.kts b/maps-utils-ktx/build.gradle.kts index f5c2905a..0700ce43 100644 --- a/maps-utils-ktx/build.gradle.kts +++ b/maps-utils-ktx/build.gradle.kts @@ -67,6 +67,9 @@ android { namespace = "com.google.maps.android.ktx.utils" } +// Workaround for com.mxalbert.gradle.jacoco-android plugin crash on AGP 9.0+ +tasks.register("testReleaseUnitTest") {} + dependencies { implementation(libs.kotlin.stdlib) api(libs.android.maps.utils)