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’ ?
Question: How to Solve Execution failed for task ‘:app:compileFlutterBuildDebug’ ?
Answer: To Solve This 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
- How to make a blur Background Image effect in Flutter using BackdropFilter.
- Create Rounded Corners Image in Flutter.
- set Background Image to Scaffold in Flutter.
- How To Select multiple images with Flutter
- How to Set Network Image In Circular Avatar In Flutter?