flutter error gradlew

2 Ways To Solve flutter error: Process gradlew Exited abnormally

Intro solving flutter error

In this post, I’m gonna show you how to solve one common flutter error.

If this is your first time here then I recommend you go to our first post.

Our previous posts:

  1. Flutter Beginner Learn How To Install And Set Up In 2 Steps
  2. Flutter Beginner Tutorial: Hello world Android Application

Sometimes when you first install flutter and create your first flutter app there are some things that don’t always get downloaded correctly. Hence, they later bring you errors when you first run your first app.

I did a research and come up with two methods to solve these flutter error. Especially the one that involves Gradle.

The error I’m talking about is this… Below

ProcessException: Process "{USER_URL}\android\gradlew.bat" exited abnormally:

The error running gradle processexception process android gradlew.bat exited abnormally always happen when the Gradle file mostly .zip, refuses to extract.

So let’s solve this flutter error problem in two methods

Flutter error: 1). Rerun the app with a strong internet connection.

In this method is the simplest because it involves just doing flutter run with a strong internet connection. This is to help download the Gradle file in case it was not downloaded correctly.

So here is how to do it. Move to the folder app folder then do the following ENSURE YOU HAVE STRONG INTERNET CONNECTION

flutter run

If it runs to completion then everything is now ok.

In case it didn’t work then let us move to the next step.

Flutter Error: 2). Delete and Redownload and extract the gradle.zip file

Requirements if you are using Ubuntu

  • wget : to download the new gradle-4.10.2-all.zip file
  • zip and unzip : to unzip the downloaded Gradle file

You may find them already in your system

In this method, we are going to remove the Gradle file since it may be the one causing the flutter error.

The Gradle is always in the folder .gradle so go to that folder as below

cd {USER_URL}\.gradle\wrapper\dists\gradle-4.10.2-all\9fahxiiecdb76a5g3aw9oi8rv

NOTE: the folder: /9fahxiiecdb76a5g3aw9oi8rv/ may differ.

Once you are in, run the following commands

rm  gradle-4.10.2-all.zip
wget https://services.gradle.org/distributions/gradle-4.10.2-all.zip
unzip gradle-4.10.2-all.zip

These commands work on Linux systems but if you install rm, wget and unzip in Windows it will work.

Let’s go through the commands we ran.

rm gradle-4.10.2-all.zip removes the faulty Gradle file.

wget https://services.gradle.org/distributions/gradle-4.10.2-all.zip will download the new Gradle file.

unzip gradle-4.10.2-all.zip unzips the downloaded Gradle file.

With all that done now lets run flutter. By now I know the flutter gradew error is gone.

flutter run

Conclusion

We solved the flutter error problem by running futter run with a strong internet connection.

Finally, we opted for the second method in case the first one dint work. The second involves the following…

rm  gradle-4.10.2-all.zip
wget https://services.gradle.org/distributions/gradle-4.10.2-all.zip
unzip gradle-4.10.2-all.zip

Then move to the flutter app folder and run…

flutter run

Thank you for coming by.

Happy Codding.

Leave a Comment

Your email address will not be published. Required fields are marked *

Pin It on Pinterest