6

When I'm trying to use Android Gradle Plugin 3.0.+ with Intellij IDEA, I'm getting error: Error:This Gradle plugin requires Studio 3.0 minimum

But my version of IntelliJ is higher than 2017.2 and it should work with gradle plugin for AS 3.0.

2 Answers 2

28

It can be fixed by adding this option to your gradle.properties:

android.injected.build.model.only.versioned=3 

Explanation:

From Reddit /r/androiddev

A version check is in place in ModelBuilder that is fed by Gradle properties inserted by the IDE when you execute the Sync action. The fix is to add the following to gradle.properties: android.injected.build.model.only.versioned=3

AS 3.0 is sending the value 3, whereas older versions as well as IntelliJ send 1 or lower, if they send a value at all. Once set as specified, sync works again and everything so far has been operating normally.

Full answer with comments from Android Studio team

UPDATE

IntelliJ IDEA 2018.1+ supports Android Gradle Plugin 3.0+!

Sign up to request clarification or add additional context in comments.

Comments

1

Adding the android.injected.build.model.only.versioned=3 property in the gradle.properties file (as suggested here) will get the Gradle sync working but you may run into issues when trying to deploy your Android app onto a device or emulator from within IntelliJ. For that you'll probably have to use Android Studio 3.x or one of the install Gradle tasks... until a version of IntelliJ IDEA is released that supports Android 3.x features (keep an eye on this JetBrains issue).

6 Comments

What issues you mean? I use IDEA as main IDE and haven't any issues.
Mainly the issues I'm seeing are around installing the APK on the device or emulator when trying to run the app or instrumentation tests from IntelliJ. I suspect these issues will be fixed with the release of IDEA 2017.3 (see link in my answer) but in the meanwhile I'm using Android Studio.
Have you found a solution to this? I am facing the exact same problem with IDEA 2017.3
I've resorted to using Android Studio until Android Studio 3.0 features are added to IntelliJ. I've updated my answer to link to the JetBrains issue that's open for this.
@kliron, try to add flag -t to your app Run Configuration in Intellij IDEA
|

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.