Agp 9 Upgrade
Android (Google)OfficialCreated by Google LLCDistributed by Android (Google)
- Skill
- Workflow
- Software development
- Apache-2.0
- No issues found
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
This skill provides a structured workflow to upgrade Android projects to AGP 9. It handles the transition to built-in Kotlin support, updates dependencies like KSP and Hilt, migrates to the new AGP DSL, and cleans up obsolete properties in gradle.properties. It is designed for standard Android projects and explicitly excludes Kotlin Multiplatform (KMP) projects.
What it does
- Updates project dependencies including KSP and Hilt to compatible versions.
- Facilitates the migration to AGP 9 built-in Kotlin support.
- Guides the transition to the new AGP DSL interfaces.
- Assists in migrating from kapt to KSP or legacy-kapt.
- Cleans up deprecated flags in gradle.properties.
- Verifies the migration through Gradle sync and build checks.
When to use it
- When you need to upgrade an existing Android project to AGP 9.
- When you are ready to adopt built-in Kotlin support in your Android modules.
- When your project requires migration to the new AGP 9 DSL interfaces.
- When you need to update build dependencies to ensure compatibility with AGP 9.
Advantages
- Simplifies complex build system migrations through a guided, step-by-step process.
- Ensures project compatibility with the latest Android build tools and JDK requirements.
- Reduces build configuration overhead by leveraging built-in Kotlin support.
- Provides clear verification steps to ensure the project remains in a buildable state.
Usage examples
- “Migrate my Android project to AGP 9.”
- The agent will check your current AGP version, guide you through dependency updates, DSL changes, and built-in Kotlin migration, and verify the build.
- “Help me update my app to use AGP 9 and the new DSL.”
- The agent will initiate the migration workflow, ensuring your build files are updated to the new DSL interfaces and removing obsolete properties.
Install
Download the skill as a ZIP:
https://mp-staging.autogineer.com/agent-skills/android/agp-9-upgrade/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip agp-9-upgrade.zip -d .agents/skills
Documentation by Google LLC
Migration guide
See the AGP 9 migration guide for the major changes, many breaking, in AGP 9 compared to AGP 8.
Requirements
If the user requests to update or migrate to AGP 9, first check the AGP version used in the project. If it is lower than 9, stop and ask the user to run the AGP Upgrade Assistant in Android Studio to update to the latest stable version of AGP, and confirm when done. The user may also request that this requirement be skipped; if this is the case, you should update the version of AGP to the latest stable version as part of the AGP 9 migration. See the AGP 9 migration guide for how to do this.
Each version of AGP has its own set of compatibilities with other tools, such as Gradle, JDK, and Kotlin. The release notes for each of these versions will include a Compatibility table indicating the minimum versions for these tools.
Do not use this skill for KMP projects, as they are unsupported.
Steps
If AGP is already at 9 or higher, then do the following:
Step 1: Update dependencies
If KSP (com.google.devtools.ksp) is used in the project, ensure it is on
version 2.3.6 or higher.
If Hilt is used in the project, ensure it is on version 2.59.2 or higher.
Step 2: Migrate to built-in Kotlin
See the guide for detailed information.
Step 3. Migrate to the new AGP DSL
See the guide for detailed information.
See also gradle-recipes for examples on how to migrate old code to code that is compatible with AGP 9 and the new DSL.
Step 4. Migrate kapt to KSP or legacy-kapt
If KSP (com.google.devtools.ksp) or kapt (org.jetbrains.kotlin.kapt) are
used in the project, see KSP, kapt, and legacy-kapt for detailed migration
steps.
Step 5. BuildConfig
If any Android module contains custom BuildConfig fields, see BuildConfig for detailed information.
Step 6. Update gradle.properties
After the migration, check gradle.properties. Remove the following flags:
android.builtInKotlin
android.newDsl
android.uniquePackageNames
android.enableAppCompileTimeRClass
Additionally, delete all temporary files you've created.
Guidelines
Never write or run python scripts.
Only search the Gradle dependency cache when inspecting external dependencies, and only as a last resort.
Never add
android.disallowKotlinSourceSets=falsetogradle.properties.When verifying changes, don't run the
cleantask. This is a waste of time.
Verification
After migration, verify the following:
Gradle IDE sync succeeds.
./gradlew helpsucceeds../gradlew build --dry-runsucceeds.
Troubleshooting
Paparazzi v2.0.0-alpha04 and lower versions have issues with AGP 9. See references/paparazzi-gradle-9.md for details.
Files
- ATTRIBUTION.mdAdded by AutoGineer970 B
- LICENSELicence file added by AutoGineer11.1 KiB
- SKILL.md3.4 KiB
- references/android/build/migrate-to-built-in-kotlin.md13.1 KiB
- references/android/build/releases/agp-9-0-0-release-notes.md51.3 KiB
- references/buildconfig.md1.5 KiB
- references/ksp-kapt.md1.7 KiB
- references/paparazzi-gradle-9.md1.1 KiB
- references/recipes.md2.2 KiB
references/paparazzi-gradle-9.md
If Paparazzi is used in the project, update it to version 2.0.0-alpha04 or higher.
Paparazzi version 2.0.0-alpha04 and lower is not fully compatible with Gradle 9, and Gradle 9 is required by AGP 9. This means that, without workarounds, projects that use Paparazzi v2.0.0-alpha04 and lower cannot migrate to AGP 9.
At time of writing, there are no higher versions of Paparazzi. That is, v2.0.0-alpha04 is the latest release.
The issue is due to Paparazzi using internal classes from Gradle that tend to
move in breaking ways without warning. This specific issue is related to HTML
test reports. To work around it, disable those HTML test reports. Here
are two examples of how to do this, one for Kotlin DSL and the other for Groovy
DSL. Any module that has the paparazzi plugin (app.cash.paparazzi) applied
must apply one of these two workarounds.
Kotlin DSL:
tasks.withType<Test>().configureEach {
// https://github.com/cashapp/paparazzi/issues/2111
reports.html.required = false
}Groovy DSL:
tasks.withType(Test).configureEach {
// https://github.com/cashapp/paparazzi/issues/2111
reports.html.required = false
}Requirements and compatibility
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Needs: Needs Python
Security
No issues found by our static scan· No issues found
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Created by
- Google LLC
- Publisher
- Android (Google) (Official)
- Distributed by
- Android (Google)
- Source
- android/skills · build-system/agp/agp-9-upgrade · commit bf68e2d
- Licence
- Apache License 2.0 (redistribution allowed)
- LICENSE (added by AutoGineer from LICENSE.txt)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
AutoGineer is not affiliated with or endorsed by Google LLC or Android (Google).
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download agp-9-upgrade.zip