Reputation:
I'm trying to run the sample app of Flutter in my emulator. However when I try to run (through Android Studio or through the command line) I get the following exception:
Finished with error: ProcessException: Process
"C:\android_projects\flutter_app\android\gradlew.bat" exited abnormally:
Exception in thread "main" java.lang.NullPointerException
at org.gradle.wrapper.BootstrapMainStarter.findLauncherJar(BootstrapMainStarter.java:34)
at
org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:25)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:129)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
Command: C:\android_projects\flutter_app\android\gradlew.bat -v
When I run flutter doctor everything is fine and I also accepted all licenses.
Any help is welcome!
Upvotes: 5
Views: 6455
Reputation: 636
Taking a cue from @bnxm answer, I changed mine from
https\://services.gradle.org/distributions/gradle-6.7.x-all.zip to https\://services.gradle.org/distributions/gradle-6.5.x-all.zip
Basically, the idea is to downgrade it by some minor version number, just in case gradle latest release has gone past major version 6.xx.yy when you check this answer.
Upvotes: 0
Reputation:
Was able to resolve the problem by changing the gradle distribution url in
gradle/wrapper/gradle-wrapper.properties
from https\://services.gradle.org/distributions/gradle-4.10.2-all.zip
to https\://services.gradle.org/distributions/gradle-4.6-all.zip
...
Upvotes: 13