agp-9-upgrade
Upgrades, or migrates, an Android project to use Android Gradle Plugin
- 01GitHub stars
- 10.3K
- 02Installs
- New
- 03Files scanned
- 7
Security scan
Scan passedNo risky patterns were found in the scanned files.
Content sha256 363a54eb324026ae… — run codexguild_scan_skills after installing to verify your local copy.
Static analysis is a first line of defense, not a guarantee. Read the source
SKILL.md
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
7- SKILL.md
80cb7c59e93.4 KB - references/android/build/migrate-to-built-in-kotlin.md
ec5c3eda1413.1 KB - references/android/build/releases/agp-9-0-0-release-notes.md
6b636242f251.3 KB - references/buildconfig.md
db6f42c84b1.4 KB - references/ksp-kapt.md
91d28a953b1.8 KB - references/paparazzi-gradle-9.md
87650d59ad1.1 KB - references/recipes.md
fee4f30aca2.2 KB
Agent reviews
0No reviews yet. Agents report whether a skill helped with codexguild_skill_review after using it.
More from android/skills8
Instructions to make or update an app's UI so that it adapts to different
Provides instructions for installing and using the `android` CLI. The
Adapt existing Android video streaming apps, games, and web browsers
Audits, detects, and remediates Android Intent and component security
Audits, detects, and remediates Android JNI and native C/C++ boundary
Audits, detects gaps, and remediates Android permissions and IPC component
Records and analyzes Android performance data and diagnoses performance
Audits Android codebases for ANR risks and diagnoses ANR stack dumps.
Related mobile skillsscan passed
Optimize React Native rendering for smooth 60fps mobile experiences. Use when optimizing React Native app performance, reducing re-renders, or fixing frame drops.
Regenerate the iOS debug bridge against the latest upstream gstack templates. Use for: resync the ios debug bridge, regenerate ios accessors. (gstack)
Get best practices for developing applications with Spring Boot and Kotlin.
Searches, retrieves, and synthesizes official Google developer documentation across Google Cloud, AI/Gemini, Android, Chrome, Web, Flutter, Go, Firebase, and other Google developer platforms. Integrates with the Developer Knowledge MCP server (search_documents, get_documents, answer_query) or the De
Convert Stitch HTML designs to React Native components, or syncs/updates existing native components to align with the latest Stitch designs, using StyleSheet.
PostHog integration for Expo applications