Reputation: 138
I am running on Windows 10.
I just updated the Android studio to 3.6, and my app is no longer syncing. I'm getting 3 separate responses for the failure
Caused by: org.gradle.api.internal.plugins.PluginApplicationException: Failed to apply plugin [id 'com.android.internal.version-check']
Caused by: java.lang.RuntimeException: Minimum supported Gradle version is 5.6.4. Current version is 5.4.1. If using the gradle wrapper, try editing the distributionUrl in C:\Users\redacted\redacted\Documents\Android Studio\app\gradle\wrapper\gradle-wrapper.properties to gradle-5.6.4-all.zip
ERROR: Minimum supported Gradle version is 5.6.4. Current version is 5.4.1.
Please fix the project's Gradle settings.
Fix Gradle wrapper and re-import project (Appears as an un-clickable link for me)
Open Gradle wrapper properties (Appears as an un-clickable link for me)
Gradle settings (Appears as an un-clickable link for me)*
Being smart as I am, I checked my gradle-wrapper properties:
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
In the project structure, the Gradle version is also correct, 5.6.4.
I have uninstalled and reinstalled Android Studio.
I have also tried running the program on a different machine.
I created a brand new (working!) project to compare the gradle-wrapper properties file and everything matches.
Please help me out if you can.
Upvotes: 4
Views: 9050
Reputation: 709
I followed the advice of these awesome Flutter error messages and simply replaced in my project's file <project>/android/gradle/wrapper/gradle-wrapper.properties
the line distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip
by distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
(thereby only changing the version of the employed gradle module).
That solved the issue.
Upvotes: 0
Reputation: 19
Yes, it just ignores what is in gradle-wrapper.properties. After a week of frustration and trying dozens of different solutions that didn't solve it...
Create a new 3.6.1 dummy project and Gradle Sync to force download of the new Gradle distribution.
Then in File -> Settings -> Gradle, set Use Gradle from to Specified location and set the full path of where your gradle is (e.g. C:\Users\Duncan\.gradle\wrapper\dists\gradle-5.6.4-all\ankdp27end7byghfw1q2sw75f\gradle-5.6.4
). And finally it works again!
Then you can delete the new dummy project.
Why is Android Studio / Gradle so ridiculously overcomplicated and unreliable ? Every upgrade is a nightmare.
Upvotes: 0
Reputation: 11
I renamed the project directory and re-imported the project, and it worked. Then I changed it back to the old name and it continued working. Magic!
P.S. BTW I also deleted all the .iml files .idea .gradle files gradle gradlew gradlew.bat files also.
Upvotes: 1
Reputation: 138
Update as to how I resolved the situation. I started a brand new project, and copied over all the Kotlin and XML code. I'm still not sure what went wrong.
Upvotes: 1