Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4791 pages

Flutter and app store releases · Troubleshooting walkthrough

Android Studio's AGP Upgrade Assistant blocks a step or ends in Sync Failed

Short answer

The Upgrade Assistant failed to upgrade this project when a step is blocked or the build cannot sync afterwards. A blocked step names its reason, often Cannot find AGP version in build files or jcenter before AGP 9. Fix it by hand and rerun; after Sync Failed, press Revert Project Files. Covers Android Studio Rabbit 2, AGP 7.1 to 9.5.

  • Applies to Android Studio Rabbit 2 2026.2.2 (opens AGP 7.1 to 9.5), Android Gradle plugin 8.13.2 to 9.5.2, Gradle 9.9.2
  • Updated
  • By Maaz Zindani, Senior Software Engineer

The Upgrade Assistant runs a list of required steps to move a project to a newer Android Gradle plugin (AGP). It stops with failed to upgrade this project when a step is blocked, or when the new build will not sync afterwards. A blocked step says so, with the reason underneath, and each reason points at something you can fix by hand and then retry.

Work through the stages in order: find the blocked step, read its reason, fix that, and if the sync fails after the upgrade, revert and go in smaller hops.

The text you see

  • The Upgrade Assistant failed to upgrade this project, finding no way of performing the following command:
  • This project is using Android Gradle plugin version 7.0.4, which is incompatible with this version of Android Studio.
  • Cannot find AGP version in build files.
  • jcenter is a deprecated property
  • Sync Failed. The project failed to sync with the IDE.

Stage 1

Stage 1: find the blocked step and where AGP is declared

Open Tools > AGP Upgrade Assistant and click each required step. A blocked step shows This step is blocked with the reason beneath it. Then list every place the build declares the Android Gradle plugin, because two of the causes depend on where that version lives.

Every declaration of the plugin

grep -rn --include=*.gradle --include=*.kts --include=*.toml \
  -e "com.android.application" -e "com.android.library" -e "com.android.tools.build:gradle" .
Reason shownMeaningSection
Cannot find AGP version in build filesThe assistant cannot read where the version is setStage 2
jcenter is a deprecated propertyjcenter() in the root buildscript while targeting AGP 9 or newerStage 3
Incompatibility between Android Studio and Android Gradle pluginThe project's AGP is older than this Studio can openStage 4
Sync Failed after running stepsThe new AGP rejects something in the buildStage 5

Stage 2

Stage 2: Cannot find AGP version in build files

The assistant works by static analysis of the build files. It does not follow constants defined in buildSrc, version catalogs declared inside settings files, or catalogs used for anything other than dependencies and plugins. If the files were edited outside the IDE, a fresh sync may already clear the block.

If not, move the version into gradle/libs.versions.toml, apply the plugin by its catalog alias, sync, and open the assistant again.

AGP version in the catalog (use your own version number)

# gradle/libs.versions.toml
[versions]
androidGradlePlugin = "8.13.2"

[plugins]
android-application = { id = "com.android.application", version.ref = "androidGradlePlugin" }

// top-level build.gradle.kts
plugins {
    alias(libs.plugins.android.application) apply false
}

Stage 3

Stage 3: jcenter and a target of AGP 9

For a target of AGP 9.0 or later, the assistant refuses to run while the root build file's buildscript block still calls jcenter(), and it explains that Gradle 9 no longer supports that repository. Picking an 8.x target makes the block disappear, which confirms this is the cause.

Replace jcenter() in every repositories block

buildscript {
    repositories {
        google()
        mavenCentral()   // was jcenter()
    }
}

Sync on the old AGP first. Then, with a 9.x target chosen, the version step should no longer be blocked.

Stage 4

Stage 4: the project's AGP is too old for this Studio

A dialog titled Incompatibility between Android Studio and Android Gradle plugin appears when the project's AGP is outside the range the installed Studio supports. The assistant lists the blocked commands, and each has a reason like the ones above. Clear them by hand first, then let it raise AGP.

For a very old project, upgrade in hops. An older Android Studio whose supported range still includes the current AGP can move it forward first; the Android Studio releases page has the compatibility table.

Which AGP does the project use

grep -rn "com.android.tools.build:gradle" build.gradle* settings.gradle*

Stage 5

Stage 5: Sync Failed after the steps ran

Sync Failed with The error message from sync is: and a Revert Project Files button means the edits applied but the new AGP rejects something. That is common on the jump from 8.x to 9.x: the kotlin-android plugin, the old variant API and third-party plugins that still expect the old DSL.

Press Revert Project Files, then go in smaller pieces. For AGP 9, keep the assistant's steps Preserve the old (internal) AGP Dsl APIs and Disable built-in Kotlin support selected until your plugins are ready. They write the two flags below, and the AGP 9.0 release notes say the newDsl opt-out goes away in AGP 10, so plan to remove both.

The temporary opt-outs, and the command to read the real sync error

# gradle.properties, written by the assistant's opt-out steps
android.newDsl=false
android.builtInKotlin=false
./gradlew help --stacktrace

Stage 6

Confirm and keep the upgrade safe

The assistant should report Sync succeeded. Then build and run the tests before committing. Commit before every assistant run, so a failed sync can be undone from version control as well as from the Revert button.

Build and unit tests after the upgrade

./gradlew assembleDebug testDebugUnitTest

If every step syncs but the final upgrade still fails, the AGP documentation asks for a bug report with the assistant's output.

If you only keep one thing

  • Read the reason under the blocked step; it names the fix.
  • Keep the AGP version in gradle/libs.versions.toml.
  • Both opt-out flags in gradle.properties are short-term; remove them once your plugins catch up.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Next step

Want a second pair of eyes on it?

Send me the error and what changed before it started. I reply within 24 hours.