Reputation: 483
I cannot update my project. When I try to do this I got this message
The Upgrade Assistant failed to upgrade this project, finding no way of performing the Upgrade AGP version from 4.1.3 to 4.2.0 command, possibly because the project's build files use features not currently supported by the Upgrade Assistant (for example: using constants defined in buildSrc, or other unrecognized constructs, in Gradle build files).
What can i do about it?
Upvotes: 34
Views: 66462
Reputation: 11
I just changed the Android Plugin Version
to fix this issue. I was using Version 3.0.2
and I moved to Version 7.0.0
. I am happy to tell you this.
Upvotes: 1
Reputation: 125
In my case I have change the Gradle JDK version 1.8 -> 11 It fix the issue.
Upvotes: 1
Reputation: 1511
I had this happen because the Gradle plugin dependency declaration was in a separate variable. After moving the declaration back, directly to build.gradle as:
buildscript {
...
dependencies {
classpath 'com.android.tools.build:gradle:$your_version'
...
}
}
The error disappeared and Upgrade Assistant started working normally.
Upvotes: 9
Reputation: 1929
You have to manually change the gradle versions in build.gradle.kts
(project) and then in gradle-wrapper.properties
to version that matches your build.gradle.kts version
For example
build.gradle.kts
"com.android.tools.build:gradle:7.0.0-alpha14"
gradle-wrapper.properties
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0-all.zip
Naturally, change the versions accordingly to what you're using
Upvotes: 36
Reputation: 5
This happened when I upgraded Android Studio to Canary without uninstalling my previous version. Many issues were resolved when I pointed all IDEs to the same location of JDK.
Upvotes: 0