I was trying to run my Flutter app and this shows up:
I do flutter clean, I delete pubspec.lock
FAILURE: Build failed with an exception.
-
Where:
Script ‘/Users/mac/development/flutter/packages/flutter_tools/gradle/flutter.gradle’ line: 1005 -
What went wrong:
Execution failed for task ‘:app:compileFlutterBuildDebug’.
Process ‘command ‘/Users/mac/development/flutter/bin/flutter” finished with non-zero exit value 1
-
Try:
Run with –stacktrace option to get the stack trace. Run with –info or –debug option to get more log output. Run with –scan to get full insights. -
Get more help at https://help.gradle.org
BUILD FAILED in 21s
Exception: Gradle task assembleDebug failed with exit code 1
3
Answers
It seems that you missed running pub get after running flutter clean. Build task issues similar to what you’ve encountered could be usually solved by running
flutter clean
to clear the project’s build cache and runningflutter pub get
to fetch the project’s dependencies configured in the project’s pubspec.yamlDelete
android/app/build
folder and runflutter clean
worked for me.. 🙂
Just delete the pubsec.lock file and run the project, it worked for me 😉