Skip to content
Skillv1.0.0

agp-9-upgrade

Upgrades, or migrates, an Android project to use Android Gradle Plugin (AGP) version 9

by usmonie(0) 0 installs
Free
Sign in to install

Free account. Installing gives you the manifest plus copy-paste snippets.

See reviews

About

Imported from usmonie/compass (.skills/agp-9-upgrade/SKILL.md). Install upstream with npx skills add usmonie/compass --skill agp-9-upgrade. Copyright stays with the author (Complete terms in LICENSE.txt).

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, and confirm when done.

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.

Steps

If AGP is already at 9 or higher, then do the following:

Step 1: Migrate to built-in Kotlin.

See the guide for detailed information.

Step 2. 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 3. Migrate kapt to KSP or legacy-kapt

If KSP (com.google.devtools.ksp) is used in the project, ensure it is on version 2.3.6 or higher.

See KSP, kapt, and legacy-kapt for detailed information.

Step 4. BuildConfig

If any Android module contains custom BuildConfig fields, see BuildConfig for detailed information.

Step 5. 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.

Use it

Copy one of these into your project. Installing also returns the manifest and these snippets.

yaml
targets:
  - https://api.opensmartroute.ai/api/v1/registry/usmonie-compass-agp-9-upgrade/manifest   # or paste the manifest below

Manifest

An Open Capability Manifest: the router reads it to know what this does, what it costs and when to pick it.

usmonie-compass-agp-9-upgrade.ocm.jsonjson
{
  "ocm": "1",
  "id": "usmonie-compass-agp-9-upgrade",
  "kind": "skill",
  "name": "agp-9-upgrade",
  "description": "Upgrades, or migrates, an Android project to use Android Gradle Plugin (AGP) version 9",
  "publisher": "usmonie",
  "version": "1.0.0",
  "capabilities": {
    "domains": [
      "general"
    ],
    "tags": [
      "skill-md",
      "android-gradle-plugin-9",
      "agp-9",
      "agp-upgrade",
      "agp-migration",
      "new-agp-dsl",
      "migrate-to-built-in-kotlin",
      "github"
    ],
    "languages": [
      "en"
    ]
  },
  "quality_prior": 0.6,
  "examples": [
    "Upgrades, or migrates, an Android project to use Android Gradle Plugin (AGP) version 9"
  ],
  "primary": false,
  "metadata": {
    "source": {
      "provider": "github",
      "repository": "https://github.com/usmonie/compass",
      "path": ".skills/agp-9-upgrade/SKILL.md",
      "ref": "53649c79ce6c55a8ff8ca5cc604d51ffa64548d8",
      "url": "https://github.com/usmonie/compass/blob/53649c79ce6c55a8ff8ca5cc604d51ffa64548d8/.skills/agp-9-upgrade/SKILL.md",
      "key": "usmonie/compass/.skills/agp-9-upgrade/SKILL.md"
    },
    "license": "Complete terms in LICENSE.txt"
  },
  "instructions": "## Migration guide\n\nSee the [AGP 9 migration guide](references/android/build/releases/agp-9-0-0-release-notes.md) for the major changes, many\nbreaking, in AGP 9 compared to AGP 8.\n\n## Requirements\n\nIf the user requests to update or migrate to AGP 9, first check the AGP version\nused in the project. If it is lower than 9, stop and ask the user to run the AGP\nUpgrade Assistant in Android Studio, and confirm when done.\n\nEach version of AGP has its own set of compatibilities with other tools, such as\nGradle, JDK, and Kotlin. The release notes for each of these versions will\ninclude a **Compatibilit",
  "cost": {
    "context_tokens": 619
  }
}

Fetch it by URL: GET /api/v1/registry/usmonie-compass-agp-9-upgrade/manifest?version=1.0.0

Reviews

Star ratings from people who tried it. One review per account; edit yours any time.

No reviews yet. Install it, try it, and be the first to rate it.

agp-9-upgrade - Skill - OpenSmartRoute