5

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!

2
  • check out this: stackoverflow.com/a/54176889/7924072 Commented Apr 18, 2019 at 8:01
  • Thank you but none of the answers solved my problem. I found it out by myself and posted the answer below. Commented Apr 18, 2019 at 14:07

2 Answers 2

13

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 ...

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

Comments

0

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.