I am new in Android Studio. After setup, When I am trying to import an application I am getting that error So that gradle not able to build.
Error:Could not
gradle-wrapper.properties please use grade version 6.3 or above
distributionUrl=https://services.gradle.org/distributions/gradle-6.3-all.zip
../android/gradle/wrapper/gradle-wrapper.properties
First watch this and try reinstall - https://youtu.be/trHinrIm6DM
After if you get "Could not initialize class org.codehaus.groovy.runtime.InvokerHelper"
1.install Java SDK 14 and update env path.
2."[Your RN or Flutter Project Folder]\android\gradle\wrapper\gradle-wrapper.properties" this file edit as ...(upgrade gradle version)
#Fri Jun 23 08:50:38 CEST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-all.zip
3.run gradlew in cmd path "[Your RN or Flutter Project Folder]\android\"
4.it takes time.after if shows "BUILD SUCCESSFUL" you can "flutter run" in ur project folder
Yeah It's work
(Solution) I tried my first flutter app in android studio , i was getting same error " Could not initialize class org.codehaus.groovy.runtime.InvokerHelper"
open build.gradle and update dependencies
classpath 'com.android.tools.build:gradle:4.0.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
or just hover over com.android.tools.build:grandle:(your-version)
I face this issue when I was Building my Flutter Application. This error is due to the gradle version that you are using in your Android Project. Follow the below steps:
Install jdk version 14.0.2 from https://www.oracle.com/java/technologies/javase-jdk14-downloads.html .
If using Windows open C:\Program Files\Java\jdk-14.0.2\bin , Copy the Path and now update the path ( Reffer to this article for updating the path : https://www.architectryan.com/2018/03/17/add-to-the-path-on-windows-10/ .
Open the Project that you are working on [Your Project]\android\gradle\wrapper\gradle-wrapper.properties and now Replace the distributionUrl with the below line:
distributionUrl = https://services.gradle.org/distributions/gradle-6.3-all.zip
Now Save the File (Ctrl + S), Go to the console and run the command
flutter run
It will take some time, but the issue that you were facing will be solved.
What was helpful for me (MacBook):
echo $JAVA_HOME
(it should be equal to "/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home")export JAVA_HOME="/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home"
I faced this issue because of lower version of Jdk. Previously I installed Jdk 1.7 and Android Studio 1.5.1, I got this issue. If you install Android Studio 1.5.1 or above JDK 1.8 required
So Installing JDK 1.8 solved this issue.