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

3

8

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?

Gingery answered 25/1, 2021 at 9:50 Comment(0)
U
19

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.

Ubangi answered 25/1, 2021 at 10:25 Comment(1)
Thanks a lot! Great, I'm using some special config with a multiplatform library (kotlin) and that wasn't supported by prior Android Studio so i migrated to IntelliJ IDEA. Great to be back at Android Studio. Thanks! Everything working, building and syncing! Unfortunately didn't find that answer searching the web myself. Thanks a lot!Gingery
L
3

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

Leta answered 3/4, 2022 at 15:41 Comment(0)
W
0

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

Weintrob answered 26/7, 2022 at 12:7 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.