Skip to content

Update android.gradle.plugin to v9 (major)#788

Open
renovate[bot] wants to merge 1 commit intomainfrom
renovate/major-android.gradle.plugin
Open

Update android.gradle.plugin to v9 (major)#788
renovate[bot] wants to merge 1 commit intomainfrom
renovate/major-android.gradle.plugin

Conversation

@renovate
Copy link
Contributor

@renovate renovate bot commented Jan 15, 2026

This PR contains the following updates:

Package Change Age Confidence
com.android.library (source) 8.13.29.0.0 age confidence
com.android.application (source) 8.13.29.0.0 age confidence
com.android.tools.build:gradle (source) 8.13.29.0.0 age confidence

Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about these updates again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@claude
Copy link

claude bot commented Jan 15, 2026

Pull Request Review: Update Android Gradle Plugin to v9.0.0

Overview

This PR updates the Android Gradle Plugin (AGP) from 8.13.2 to 9.0.0, which is a major version upgrade with significant breaking changes.


✅ Positive Aspects

  1. Minimal Change Scope: Only one line changed in gradle/libs.versions.toml - clean dependency update
  2. Gradle Version Compatible: The project uses Gradle 9.2.1, which exceeds AGP 9.0.0's minimum requirement of Gradle 9.1.0
  3. Kotlin Version Above Minimum: Using Kotlin 2.3.0, which is well above the AGP 9.0.0 minimum of 2.2.10

⚠️ Critical Issues & Breaking Changes

1. CI Build Failures

All CI checks are currently failing:

  • ❌ build-debug: FAILURE
  • ❌ android-lint: FAILURE
  • ❌ detekt: FAILURE
  • ❌ konsist: FAILURE
  • ❌ spotless: FAILURE
  • ❌ unit-test: FAILURE

Action Required: Investigate the build logs to identify the root cause. Common AGP 9.0 issues include:

2. New DSL Changes (Default Breaking Change)

AGP 9.0 enables android.newDsl=true by default, which removes legacy BaseExtension APIs.

Potential Impact on This Codebase:

  • Custom convention plugins in build-logic/ might be using deprecated APIs
  • Check for usage of deprecated APIs like:
    • applicationVariants, libraryVariants, testVariants → migrate to androidComponents.onVariants()
    • variantFilter → migrate to androidComponents.beforeVariants()

Recommendation: Review ApplicationConventionPlugin.kt and LibraryConventionPlugin.kt for any variant API usage.

3. Built-in Kotlin Support Enabled by Default

AGP 9.0 sets android.builtInKotlin=true by default, meaning AGP now bundles Kotlin.

Current Setup Analysis:

  • The project explicitly applies kotlin.android plugin in build.gradle.kts:9
  • This might conflict with the new built-in Kotlin

Recommendation:

  • Either remove explicit Kotlin plugin application and migrate to built-in Kotlin
  • Or add android.builtInKotlin=false to gradle.properties temporarily
  • See: Migration Guide

4. Other Default Property Changes

These properties changed defaults in AGP 9.0 (may cause behavioral changes):

Property Old Default New Default Impact
android.enableAppCompileTimeRClass false true App R classes now non-final (like libraries)
android.sdk.defaultTargetSdkToCompileSdkIfUnset false true targetSdk defaults to compileSdk if unset
android.onlyEnableUnitTestForTheTestedBuildType false true Unit tests only for debug by default
android.proguard.failOnMissingFiles false true Build fails on missing ProGuard files

Status: Your project explicitly sets targetSdk (35) in libs.versions.toml:14, which is good.

5. Removed/Deprecated Features

  • dexOptions removed (D8 replaces dx)
  • AndroidSourceSet.jni removed
  • proguard-android.txt no longer supported (use proguard-android-optimize.txt)

🔍 Code Quality Observations

Build Configuration

  • Good: Using convention plugins for build configuration consistency
  • Good: Version catalog properly configured
  • Good: Java 17 is compatible with AGP 9.0

Areas to Verify

  1. ProGuard Configuration (app/build.gradle.kts:23):

    proguardFiles("proguard-android.txt", "proguard-rules.pro")

    ⚠️ proguard-android.txt is deprecated in AGP 9.0. Should use proguard-android-optimize.txt

  2. buildConfig Feature: Explicitly enabled in both app and library plugins - good, as this is required in AGP 9.0

  3. Gradle Configuration Cache: Already enabled in gradle.properties:14 - excellent for build performance


🔒 Security Considerations

  • API Token Exposure: The codebase stores API token in gradle.properties:23 in plain text. While acknowledged as acceptable for this sample project, ensure this pattern isn't copied to production projects.

🧪 Test Coverage

Observation: The project has comprehensive test infrastructure:

  • JUnit5 configured
  • Mockk, Kluent for testing
  • Espresso for UI tests
  • Konsist for architecture tests

Concern: All test CI checks are failing. Need to verify:

  • Are tests failing due to AGP compatibility issues?
  • Are tests themselves still valid with AGP 9.0 changes?

🚀 Performance Considerations

AGP 9.0 includes several performance improvements:

  • ✅ Better configuration cache support (already enabled in this project)
  • ✅ Improved incremental compilation
  • ✅ Faster R8 optimization

📋 Recommendations

Immediate Actions (Before Merge)

  1. Fix CI Build Failures: Review build logs and address all failing checks
  2. Verify Kotlin Plugin Configuration: Decide on built-in Kotlin vs. explicit plugin
  3. Update ProGuard Reference: Change proguard-android.txt to proguard-android-optimize.txt if used
  4. Test Migration Path:
    • Consider adding temporary opt-out properties to gradle.properties if quick fix needed:
      android.newDsl=false
      android.builtInKotlin=false
    • Then create follow-up tasks to properly migrate

Follow-up Tasks

  1. Audit Variant API Usage: Review all convention plugins for deprecated variant APIs
  2. Review AGP Upgrade Assistant: Consider running AGP's built-in upgrade assistant
  3. Update Documentation: Document any migration steps or opt-outs applied
  4. Performance Benchmarking: Measure build times before/after to verify improvements

Testing Checklist

  • All unit tests pass
  • All instrumented tests pass
  • Build succeeds for debug variant
  • Build succeeds for release variant
  • Lint checks pass
  • Static analysis (detekt, konsist) passes
  • Code formatting (spotless) passes
  • App launches successfully
  • Key features work as expected

📚 Resources


Summary

This is a significant upgrade that requires careful testing and likely some code changes. The PR should not be merged until all CI failures are resolved. The failures likely indicate compatibility issues that need addressing through either code migration or temporary opt-outs while planning proper migration.

Consider whether the team is ready for this major upgrade or if it should be deferred until time can be allocated for proper migration work.

@renovate renovate bot force-pushed the renovate/major-android.gradle.plugin branch from 2d9b9e4 to 942d046 Compare January 19, 2026 16:13
@renovate renovate bot force-pushed the renovate/major-android.gradle.plugin branch from 942d046 to 3fcddf3 Compare February 2, 2026 17:13
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.

0 participants