This version of Android Studio cannot open this project, please retry with Android Studio 4.0 or newer
I just had this issue. To fix it I only needed to change in my build.gradle from
classpath 'com.android.tools.build:gradle:4.0.0'
to
classpath 'com.android.tools.build:gradle:3.6.3'
The latest non 4.x version of the gradle plug-in https://developer.android.com/studio/releases/gradle-plugin
Then, after a gradle sync, everything worked properly. I didn't need to do anything else.
I was able to solve this issue by deleting ~./android/build-cache/4.x
and ~./android/build-cache/4.x.lock
After removing the file and directory above, re-start the project and check if those show up again under build-cache
. If they show up that means com.android.tools.build:gradle:4.x
is still applied somewhere in your project. I searched the file from Finder and Android Studio that had 4.x
name on it and changed it to 3.5.2
Today I was able to fixed the issue, what had happened
I was using buildSrc
to declare my dependencies, I had changed the AGP
and Kotlin
versions in buildSrc
, but when opening the project with AS canary, AS have added an extra AGP
dependency statement in addition to the existing AGP
dependency statement referring buildSrc
ex:
dependencies {
classpath GradlePlugins.GRADLE
...
classpath 'com.android.tools.build:gradle:4.0.0-alpha06'
}
Removing additionally added AGP
dependency fixed the issue.
Other than that remove the following line from repositories
blocks in project build.gradle
, since it is for a bug fix in AS Canary 4.0
// maven { url 'https://dl.bintray.com/kotlin/kotlin-eap' }