while starting a flutter application on vs code i am getting the following errors.
Launching lib\\main.dart on RMX1801 in debug mode... Exception in
I solved this error by upgrading the Gradle version.
Just go to:
android > grader\wrapper > Gradle-wrapper.properties
and then replace the current Gradle version to the new one:
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
You can see the Gradle versions in this page: https://gradle.org/releases
The steps worked for me are as follows
Hope this would be useful
For VS Code. if All answers are not working. do this.
I was finally able to solve the problem. The problem is with the gradle and low internet bandwidth. Just delete the C:\Users\USERNAME.gradle\wrapper\dists\gradle-5.6.2-all and download it manually from [https://downloads.gradle-dn.com/distributions/gradle-5.6.2-all.zip] or delete the old gradle files and let them download manually by using flutter run Be sure to check your gradle version before proceeding.
It is caused by the Gradle distribution version used. To fix this, either downgrade your Gradle version to the previous or upgrade it to the next stable one. These are the Gradle distribution versions available.
Go to
android / gradle / wrapper / gradle-wrapper.properties
and replace the current Gradle version this (or choose another from Gradle distribution)
distributionUrl=https://services.gradle.org/distributions/gradle-6.0.1-all.zip
I upgraded my Gradle version from 5.6.2 to 6.0.1, and it works fine with me.
Open the flutter projects's android directory from Android Studio . It will automatically shows you to delete old gradle version and update to current version.
I was also experiencing a similar problem. The following worked for me !
C:\Users\uejaz.gradle\wrapper\dists\gradle-5.6.2-all\9st6wgf78h16so49nn74lgtbb Move to this directory and delete gradle-5.6.2-all.zip and gradle-5.6.2 folder
Goto https://downloads.gradle-dn.com/distributions/gradle-5.6.2-all.zip and download the zip file Replace the .zip file with the one you had deleted earlier and extract the folder "gradle-5.6.2" in the same directory. I hope it will solve all your gradle-related problems.
Note: if your gradle version is different than mine, just change the version in the link provided above to download your gradle version.