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

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


Something that work for me is: Delete your pubspec.lock, and get packages in your pubspec.yaml.


Try the following:

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

Pubspec.yaml

package get

Even if this doesn't work, try removing the import dart:html; from the code and build again.Hope this resolves!


Optimizing imports (Ctrl + Alt + O) in Android Studio solved the issue for me.Studio Screenshot