How to Solve Execution Failed for Task ':App:Compileflutterbuilddebug'

how to solve Execution failed for task ':app:compileFlutterBuildDebug'

Go to pubspec.yaml file, try doing Packages get | Pub get, and then build the project again.

How to solve this issue Execution failed for task ':app:compileFlutterBuildDebug'

Update the packages in your project. Check if there is any package that needs to be updated.

I've update the package flutter_settings_ui: ^2.0.1 to latest and it solved the issues.

Execution failed for task ':app:compileFlutterBuildDevDebug'

That error is coming because you are trying to run a flutter flavor. I also got the same issue previously, (in my case) and the reason for the above error is that the main.dart file a.k.a entry point of the application doesn't have the main function defined. Instead I created seperate files for different flavors and add the main function inside. So there were two options

  1. I need to take the main function back to the main.dart file somehow. But this won't work as intended since the flavor configuration won't be injected while running the application

  2. Explicitly define the main entry point to the application (This is what I did). Open the app level build.gradle file. Then navigate to the bottom and add the line target "lib/main_uat.dart" inside the flutter tag.

    flutter {
    source "../../"
    target "lib/main_uat.dart"
    }

So each time I want to run a different variant of my application I changed the target file. This way I was able to solve the issue. Hope this helps.

How to solve this issue Execution failed for task ':app:compileFlutterBuildDebug'

Update the packages in your project. Check if there is any package that needs to be updated.

I've update the package flutter_settings_ui: ^2.0.1 to latest and it solved the issues.

How to solve Execution failed for task ‘:app:compileFlutterBuildDebug’ in Flutter

Try in lib/widgets/cirilla_phone_input/cirilla_phone_input.dart:102:20 to remove '!' operator

Flutter Error: Execution failed for task ':app:compileFlutterBuildDebug

I followed this website

https://www.programmersought.com/article/68154823442/

It was the from the prior error, so I have fixed that, and it solved the problem.



Related Topics



Leave a reply



Submit