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

Viewed 5222

I have a already try multiple methods but failed,

FAILURE: Build failed with an exception.

  • Where: Script 'C:\Users\IMBA\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1070

  • 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

give me a prefect suggestion

3 Answers

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.

  1. Delete your pubspec.lock file
  2. go to your pubspec.yaml file and click on pub get now automatically generate file and fix your your.

You need this line:

import 'package:flutter/material.dart' show BuildContext, Key, MaterialApp, StatelessWidget, Widget, runApp;
Related