Facing This issue when flutter Upgraded

Build failed with an exception.

  • Where:

Script ‘C:\Users{Username}\flutter\packages\flutter_tools\gradle\flutter.gradle’ line: 1005

  • What went wrong:

Execution failed for task ‘:app:compileFlutterBuildDebug’.

Process ‘command ‘C:\Users{UserName}\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.

BUILD FAILED in 31s

Exception: Gradle task assembleDebug failed with exit code 1