Hello Guys How are you all? Hope You all are fine. When I was trying to run my flutter app and suddenly I get the following error in mine stack track. Execution failed for task ‘:app:compileFlutterBuildDebug’ in flutter. So today Here I come with all possible solutions for this error.
We are providing you all possible solutions to solve this error. let’s start this article without wasting your time.
How Execution failed for task ‘:app:compileFlutterBuildDebug’ Error occurs ?
When I was trying to run my flutter app and suddenly I get the following error in mine stack track
FAILURE: Build failed with an exception.
* Where:
Script 'C:\Users\IMBA\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 882
* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'C:\Users\IMBA\flutter\bin\flutter.bat'' 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 16s
Exception: Gradle task assembleDebug failed with exit code 1
How to Solve Execution failed for task ‘:app:compileFlutterBuildDebug’ ?
- How to Solve Execution failed for task ':app:compileFlutterBuildDebug' ?
To Solve Execution failed for task ':app:compileFlutterBuildDebug' Error Go to the root of your project directory. Just delete pubspec.lock file. Now run pub get in your projects terminal. And then build the project again. That's it. our Error must be solved or else used below solutions.
- Execution failed for task ':app:compileFlutterBuildDebug'
To Solve Execution failed for task ':app:compileFlutterBuildDebug' Error Go to the root of your project directory. Just delete pubspec.lock file. Now run pub get in your projects terminal. And then build the project again. That's it. our Error must be solved or else used below solutions.
Solution 1
Solution That Worked For me is
- Go to the root of your project directory.
- Just delete pubspec.lock file.
- Now run pub get in your projects terminal.
- And then build the project again.
- That’s it. our Error must be solved or else used below solutions.
Solution 2
Try the following:
- Go to pubspec.yaml file in android studio.
- try doing “packages get”
- and then build the project again.
- Hope this resolves!
Solution 3
Removing .gradle folder helped
- Close android studio.
- Remove whole .gradle folder.
- Open Android studio and build.
Solution 4
Most of the time for me it’s like
- Misspelled assets name
- Non-Existing asset/directory name
Summery
So it’s all About All possible solutions. Hope this above all solution helped you a lot. Comment below Your thoughts and your queries. Comment Below on your suggestion.
Check Out Below Article
- Unhandled Exception: Bad state: Insecure HTTP is not allowed by platform in a flutter
- The argument type ‘String’ can’t be assigned to the parameter type ‘int’
- How to use Conditional statement in widget in flutter?
- How to use Hexadecimal HEX Color Code String in Flutter Dart ?
- Also Read How to Add Borders to a Widget In Flutter ?
thanks bro it was solution one for me
I am a developer and more importantly, I am a fresher and I find this blog too good and tutorials are excellent. What makes it more interesting is that it is combined with infographics too. It’s very important that developers in each and every Flutter app development company see this. Anyways, will share it with my peers. Thank you.
In case u clone a repo from git and u can run the project I recommend delet /build from androd/app and re-run It works for me
Thank You So Much
thank you so much solution 3 worked for me for google_maps_flutter for this error message.