agp-9-upgrade
ما الذي تفعله
تنقل هذه المهارة مشروع Android إلى الإصدار 9 من Android Gradle Plugin، وتحدّث التبعيات التي تحتاج إليه. وهي موجهة لمطوري 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انسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.
طريقة الاستخدام
أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.
رسالة جاهزة للصق
لـ Claude Code أو Codex أو Cursor: شغّله داخل مجلد مشروعك وستُثبَّت المهارة.
نزّل ملف SKILL.md وضعه في مجلد مهارات وكيلك.
مثال على ما تطلبه من الذكاء الاصطناعي
“رقِّ مشروع Android لدي إلى Android Gradle Plugin 9 وأصلح ما يتعطل.”
5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.
كيف تعمل
تتحقق هذه المهارة من إصدار الإضافة الحالي أولًا. إذا كان أقدم من 9، تطلب منك تشغيل Upgrade Assistant في Android Studio، إلا إذا قلت لها أن تتخطى هذه الخطوة. ثم تتبع دليل الترحيل.
المحتوى التقني (ملف 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
- آخر تحديث
- 29/10/2026
التعليقات
- …
المزيد من المهارات من هذا المستودع
camerax
10kيساعد وكيلك على بناء ميزات الكاميرا في Android باستخدام CameraX، بما في ذلك تسجيل الفيديو وأدوات الأجهزة وتأثيرات ML Kit وMedia3.
android-for-cars-parked-apps
10kيساعد وكيلك على تكييف تطبيق فيديو أو لعبة أو متصفح في Android ليعمل كتطبيق متوقف على Android Auto وAndroid Automotive.
appfunctions
10kيساعد وكيلك على إيجاد أهم المسارات في تطبيق Android وعرضها كـ AppFunctions يمكن لوكلاء الذكاء الاصطناعي وأوامر الصوت تشغيلها.
litert-lm
10kيساعد وكيلك على بناء تطبيق Android يشغّل نموذج ذكاء اصطناعي نصيًا مفتوحًا على الجهاز، باستخدام واجهة LiteRT-LM البرمجية بلغة Kotlin.
مهارات مشابهة
android-clean-architecture
280kينظّم وكيلك مشاريع أندرويد بكفاءة، ويبني الشيفرة بطريقة تجعل الصيانة وإضافة الميزات الجديدة أسهل.
compose-multiplatform-patterns
280kيساعد وكيلك على استعمال أنماط Compose Multiplatform وJetpack Compose في مشاريع KMP، وتشمل الحالة والتنقل والتصميم والأداء.
dart-flutter-patterns
280kيساعد وكيلك على كتابة شيفرة تطبيقات Dart وFlutter، باستعمال أنماط حديثة لبناء تطبيقات متينة وسهلة الإدارة.