Langsung ke konten
Skillpedia
Aplikasi mobile10k · #11907

agp-9-upgrade

Fungsinya

Skill ini memindahkan proyek Android ke Android Gradle Plugin versi 9 dan memperbarui dependensi yang membutuhkannya. Skill ditujukan bagi pengembang Android yang melakukan peningkatan tersebut. Skill tidak mencakup proyek Kotlin Multiplatform.

Kapan dipakai

  • ✓Saat proyek Android Anda masih memakai Android Gradle Plugin lama dan Anda ingin pindah ke versi 9.
  • ✓Ketika peningkatan ke Android Gradle Plugin 9 merusak build Anda dan Anda membutuhkan langkah migrasinya.
  • ✓Ketika Anda ingin KSP atau Hilt diperbarui ke versi yang cocok dengan Android Gradle Plugin 9.

Link skill

https://github.com/android/skills/blob/main/build-system/agp/agp-9-upgrade/SKILL.md

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/android/skills/blob/main/build-system/agp/agp-9-upgrade/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit →

Contoh permintaan ke AI

“Tingkatkan proyek Android saya ke Android Gradle Plugin 9 dan perbaiki yang rusak.”

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Skill memeriksa dulu versi plugin Anda saat ini. Jika di bawah 9, skill meminta Anda menjalankan Upgrade Assistant di Android Studio, kecuali Anda meminta untuk melewati langkah itu. Lalu skill mengikuti panduan migrasi.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.

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:

  1. android.builtInKotlin
  2. android.newDsl
  3. android.uniquePackageNames
  4. 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=false to gradle.properties.
  • When verifying changes, don't run the clean task. This is a waste of time.

Verification

After migration, verify the following:

  1. Gradle IDE sync succeeds.
  2. ./gradlew help succeeds.
  3. ./gradlew build --dry-run succeeds.

Troubleshooting

Paparazzi v2.0.0-alpha04 and lower versions have issues with AGP 9. See references/paparazzi-gradle-9.md for details.

Pertanyaan umum

Apakah saya perlu menjalankan Upgrade Assistant terlebih dahulu?

Skill meminta Anda menjalankannya jika proyek berada di versi di bawah 9, kecuali Anda meminta untuk melewati langkah itu.

Apakah ini berlaku untuk proyek Kotlin Multiplatform?

Tidak. Proyek tersebut tidak didukung oleh skill ini.

Alat lain apa yang perlu diperbarui?

Beberapa alat, seperti KSP dan Hilt, memerlukan versi minimum, dan skill ini memperbaruinya.

Detail

Deskripsi asli dari pembuat

Upgrades, or migrates, an Android project to use Android Gradle Plugin (AGP) version 9. Do not use this skill for migrating Kotlin Multiplatform (KMP) projects.

repo: android/skills

Popularitas

Bintang GitHub
10k
Peringkat
#11907
Lisensi
Apache-2.0
Diperbarui
29/10/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa