Home > Software engineering >  Gradle task assembleDebug failed with exit code 1 - Flutter
Gradle task assembleDebug failed with exit code 1 - Flutter

Time:10-04

Having this error whenever running a project in Visual Studio Code.

Error

CodePudding user response:

here's very lightweight solution with steps:

  • Ctrl Alt Shift S or File->Project Structure

  • Select Project from left panel

  • Now check your Gradle Version at right panel

  • In my case my Gradle Version is 3.3

  • Navigate C:\Users\ashish.gradle\caches and delete your Gradle
    Version - 3.3 named folder.

  • Now restart or open your project again from workspace.

CodePudding user response:

Solution I figured out myself:

  1. Go to this location: " C:\Users\yourUserName "

  2. Delete the folder ".gradle" completely from this directory.

  3. Run the code again in VS Code by "flutter run" or "F5", then it will recreate the ".gradle" folder in the same directory and fix the issue.

  4. Now you can run your code easily in VS Code and use your emulators.

Problem Solved, Enjoy!

  • Related