Skip to content

Upgrade to Android Gradle Plugin 9.1.0#2318

Open
greg7gkb wants to merge 1 commit intocashapp:masterfrom
greg7gkb:agp-9-upgrade
Open

Upgrade to Android Gradle Plugin 9.1.0#2318
greg7gkb wants to merge 1 commit intocashapp:masterfrom
greg7gkb:agp-9-upgrade

Conversation

@greg7gkb
Copy link
Copy Markdown

Summary

Upgrades AGP from 8.13.2 → 9.1.0 and removes all AGP 8 compatibility shims, leaving the project fully compliant with AGP 9 defaults.

What changed

  • libs.versions.tomlagp = "9.1.0", androidTools = "32.1.0"
  • PaparazziPlugin.ktCommonExtension no longer takes type parameters in AGP 9
  • paparazzi-preview-lints/build.gradle — propagate ANDROID_HOME to test sub-builds; AGP 9 requires local.properties for SDK location, env var alone is not sufficient in nested builds
  • ~89 fixture build files — removed id 'kotlin-android' and kotlinOptions { jvmTarget } blocks; AGP 9 defaults android.builtInKotlin=true, which auto-applies Kotlin and makes the explicit plugin redundant; jvmTarget is already implied by compileOptions.targetCompatibility
  • report-snapshots/build.gradle — migrated android { kotlinOptions {} } to top-level kotlin { compilerOptions {} }; AGP 9 defaults android.newDsl=true, which no longer supports kotlinOptions inside android {}
  • gradle.properties (root) + 5 fixture gradle.properties files — removed android.builtInKotlin=false and android.newDsl=false compat flags
  • PaparazziPluginTest.kt — added android.onlyEnableUnitTestForTheTestedBuildType=false to generated fixture properties (AGP 9 defaults this to true, restricting unit tests to debug-only); removed build/generated/res/resValues/debug from 4 assertions (AGP 9 omits this path when no resValues are configured); added new test verifying the path is present when resValues are explicitly configured (buildFeatures.resValues=true is also required explicitly in AGP 9)

Intentional carve-outs: multiplatform-plugin-with-android and multiplatform-plugin-without-android fixtures retain android.builtInKotlin=false and android.newDsl=false — AGP 9 explicitly blocks the com.android.library + kotlin.multiplatform combination with builtInKotlin=true. These fixtures specifically test the legacy KMP path.

Test plan

  • ./gradlew build passes (91 tests, 0 failures)
  • ./gradlew :sample:testDebug passes
  • Tested on macOS with Java 21

@greg7gkb greg7gkb force-pushed the agp-9-upgrade branch 2 times, most recently from 45632b6 to a7d377e Compare April 11, 2026 07:26
- Bump agp to 9.1.0, androidTools to 32.1.0
- Fix CommonExtension usage: no longer takes type parameters in AGP 9
- Propagate ANDROID_HOME to paparazzi-preview-lints test sub-builds;
  AGP 9 requires local.properties for SDK location, env var alone is
  not sufficient in nested builds
- Remove ~89 explicit kotlin-android plugin declarations from fixture
  build files; AGP 9 defaults android.builtInKotlin=true, which
  auto-applies Kotlin and makes the explicit plugin redundant
- Remove kotlinOptions { jvmTarget } blocks from fixture build files;
  jvmTarget already defaults from compileOptions.targetCompatibility
- Migrate report-snapshots fixture from android { kotlinOptions {} }
  to top-level kotlin { compilerOptions {} }; AGP 9 defaults
  android.newDsl=true which no longer supports kotlinOptions inside
  android {}
- Remove android.builtInKotlin=false and android.newDsl=false compat
  flags from root gradle.properties and applicable fixture properties
- Add android.onlyEnableUnitTestForTheTestedBuildType=false to
  generated fixture gradle.properties; AGP 9 defaults this to true,
  restricting unit tests to the debug variant only
- Remove build/generated/res/resValues/debug from 4 test assertions;
  AGP 9 omits this path from variant.sources.res.all when no resValues
  are configured
- Add test verifying resValues path is present when explicitly
  configured (buildFeatures.resValues=true required in AGP 9)
- Retain android.builtInKotlin=false in multiplatform-plugin-with-android
  and multiplatform-plugin-without-android fixtures; AGP 9 explicitly
  blocks com.android.library + kotlin.multiplatform with builtInKotlin=true
@greg7gkb
Copy link
Copy Markdown
Author

@eboudrant as you wish 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant