agp-9-upgrade
できること
このスキルは、Androidプロジェクトを Android Gradle Plugin バージョン9に移行し、それに必要な依存関係を更新します。アップグレードを行うAndroid開発者向けです。Kotlin Multiplatformのプロジェクトは対象外です。
使う場面
- ✓Androidプロジェクトがまだ古いAndroid Gradle Pluginを使っていて、バージョン9に移行したいとき。
- ✓Android Gradle Plugin 9へのアップグレードでビルドが壊れ、移行の手順が必要なとき。
- ✓KSPやHiltを、Android Gradle Plugin 9で動くバージョンに更新したいとき。
スキルのリンク
https://github.com/android/skills/blob/main/build-system/agp/agp-9-upgrade/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“AndroidプロジェクトをAndroid Gradle Plugin 9にアップグレードし、壊れた箇所を直してください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
このスキルは、まず現在のプラグインのバージョンを確認します。9より古い場合は、その手順を省略するよう指示しない限り、Android StudioのUpgrade Assistantを実行するよう求めます。その後、移行ガイドに従います。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)を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:
- 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.
よくある質問
先にUpgrade Assistantを実行する必要がありますか?
プロジェクトがバージョン9より前の場合、その手順を省略するよう指示しない限り、実行するよう求められます。
Kotlin Multiplatformのプロジェクトでも使えますか?
いいえ。それらのプロジェクトはこのスキルの対象外です。
ほかに更新が必要なツールはありますか?
KSPやHiltなど、最低バージョンが必要なツールがあり、このスキルがそれらを更新します。
詳細
作者による元の説明
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
人気
- GitHubのスター
- 10k
- ランキング
- #11907
- ライセンス
- Apache-2.0
- 更新日
- 2026/10/29
コメント
- …
このリポジトリの他のスキル
camerax
10kエージェントが、CameraXを使ってAndroidのカメラ機能を作れるよう支援します。動画の録画、ハードウェアの制御、ML Kit、Media3のエフェクトを含みます。
android-for-cars-parked-apps
10kエージェントが、Androidの動画、ゲーム、ブラウザのアプリを、Android AutoとAndroid Automotiveで駐車中のアプリとして動かせるように適合させるよう支援します。
appfunctions
10kエージェントが、Androidアプリの主要な作業の流れを見つけ、AIエージェントや音声コマンドが実行できるAppFunctionsとして公開できるよう支援します。
litert-lm
10kエージェントが、LiteRT-LMのKotlin APIを使って、端末上でオープンなテキストAIモデルを動かすAndroidアプリを作れるよう支援します。
似ているスキル
android-clean-architecture
280kエージェントがAndroidプロジェクトを効率よく整理できるようにします。コードを構造化して、保守や新機能の開発をしやすくします。
compose-multiplatform-patterns
280kエージェントがKMPプロジェクトでCompose MultiplatformとJetpack Composeのパターンを使えるようにします。状態管理、ナビゲーション、テーマ設定、パフォーマンスを扱います。
dart-flutter-patterns
280kエージェントがDartとFlutterのアプリ向けのコードを書けるようにします。最新のパターンを使い、堅牢で管理しやすいアプリを作ります。