Execution failed for task ‘:app:compileFlutterBuildRelease’

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.

Solution 1

flutter clean,
flutter pub get,
flutter build appbundle --release --no-tree-shake-icons

Solution 2

Solution That Worked For me is

  1. Go to the root of your project directory.
  2. Just delete pubspec.lock file.
  3. Now run pub get in your projects terminal.
  4. And then build the project again.
  5. That’s it. our Error must be solved or else used below solutions.

Solution 3

Try the following:

  1. Go to pubspec.yaml file in android studio.
  2. try doing “packages get”
  3. and then build the project again.
  4. Hope this resolves!

Solution 4

Removing .gradle folder helped

  1. Close android studio.
  2. Remove whole .gradle folder.
  3. Open Android studio and build.

Solution 5

Most of the time for me it’s like

  • Misspelled assets name
  • Non-Existing asset/directory name