cV2
cV2

Reputation: 5317

Cannot solve 'This version of the Android Support plugin for IntelliJ IDEA cannot open this project, please retry with version 4.1 or newer.'

I'm using:

com.android.tools.build:gradle:4.1.0

and wrapper:

distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip

But still on all syncs IntelliJ IDEA gives me: enter image description here

I've once found a workaround, using an old gradle version and older build tools it was working. But this cannot be "true", anyone else facing such issues?

Upvotes: 8

Views: 26267

Answers (3)

Abdulmajeed Alyafei
Abdulmajeed Alyafei

Reputation: 577

Just update top-level build gradle in dependencies block with classpath 'com.android.tools.build:gradle:7.0.0'

Upvotes: 0

hojat72elect
hojat72elect

Reputation: 31

In 2022 this error still comes up from time to time. I had the exact same error for opening one of my old Android projects in IntelliJ IDEA 2021.3.3 (Community Edition) and faced the exact same error.

But it was solved by writing this line to "dependencies" section of project-level "build.gradle" file

        classpath 'com.android.tools.build:gradle:7.0.0'

You just need to change the version in this line so the error gets resolved

Upvotes: 3

Andrey
Andrey

Reputation: 16411

IntelliJ IDEA 2020.3 does not support Android gradle Plugin 4.1 version yet. You have two options: either downgrade AGP and use IDEA: com.android.tools.build:gradle:4.0.2

or switch to Android Studio 4.1+

Android Plugin 4.1 will be available in IDEA starting from the very first EAP of 2021.1. version EAP should start this week.

Upvotes: 19

Related Questions