Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to solve flutter.gradle and flutter.bat error?Script 'C:\src\flutter\packages\flutter_tools\gradle\flutter.gradle' && flutter.bat error

FAILURE: Build failed with an exception.

  • Where:

Script 'C:\src\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 991

  • What went wrong:

Execution failed for task ':app:compileFlutterBuildDebug'.

Process 'command 'C:\src\flutter\bin\flutter.bat'' finished with non-zero exit value 1

like image 915
mehul mulchandani Avatar asked Feb 10 '21 11:02

mehul mulchandani


2 Answers

The solution that worked for me was:

  1. Delete pubspec.lock file
  2. Do flutter pub get
  3. Run the project

And it worked.

like image 87
Rohan Patil Avatar answered Nov 15 '22 10:11

Rohan Patil


I was able to get around this by running with null safety turned off. See this article for details.

 dart --no-sound-null-safety run
 flutter run --no-sound-null-safety
like image 29
Luciano Avatar answered Nov 15 '22 11:11

Luciano