Flutter Build failed with an exception in Gradle - flutter

Since a couple of days, my code is no longer working but I don't know what I have changed and no solution on the internet worked for me so far.
Stackoverflow doesn't allow me to fill in the whole issue log because of spam but in the end it says:
FAILURE: Build failed with an exception.
* Where:
Script 'C:\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1102
* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'C:\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 15s
Exception: Gradle task assembleDebug failed with exit code 1
You can also find my whole code here: https://github.com/Burekmasta/BlogApp
Flutter doctor

Related

Error FAILURE: Build failed with an exception when running flutter emulator

I am getting error like this while running flutter with emulator in vscode. I have downloaded sdk and downloaded pixel api 30, how to solved it and I can run my code with emulator andoid?
FAILURE: Build failed with an exception.
* Where:
Script 'C:\Users\Denis\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1005
* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'C:\Users\Denis\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 32s
Exception: Gradle task assembleDebug failed with exit code 1

Script 'C:\Flutter\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1159 flutter

Since yesterday, when I try to run my Flutter project, I encounter the following error. But when I don't use Hive and Hive_Flutter package, this error is solved. Thank you for helping me.
Script 'C:\Flutter\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1159
What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
Process 'command 'C:\Flutter\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 12s
Exception: Gradle task assembleDebug failed with exit code 1

Getting an error white running flutter application "FAILURE: build failed with an exception"

I am getting an error while running my flutter application through vscode the error "FAILURE: build failed with an exception"
I attach the full error below.
Since I am new to this environment I don't know about this, please help me, Thank you!
FAILURE: Build failed with an exception.
* Where:
Script 'C:\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1256
* What went wrong:
Could not determine the dependencies of task ':app:compileFlutterBuildDebug'.
> Index 1 out of bounds for length 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 18s
Exception: Gradle task assembleDebug failed with exit code 1

I am seeing this error "Execution failed for task ':app:compileFlutterBuildDebug'."

I have run flutter upgrade after that it told me to Flutter App Migration from Previous Version (Android Embedding V2), and after doing it, I am seeing this error.
Error image
error message
[FAILURE: Build failed with an exception.
Where:
Script 'C:\src\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1102
What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
Process 'command 'C:\src\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 32s
Exception: Gradle task assembleDebug failed with exit code 1

Exception: Gradle task assembleDebug failed with exit code 1 finished with non-zero exit value 1

FAILURE: Build failed with an exception.
Where:
Script 'C:\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 991
What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
Process 'command 'C:\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 17s
check if you can update your flutter version
Also you could try flutter clean, and then flutter pub get