title: How to solve the error FAILURE: Build failed with an exception. * Where: Script 'C:\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1005
body: <p>I'm trying to run the application in the android emulator but this error keeps popping.</p>
  <pre><code>    FAILURE: Build failed with an exception.
  
  * Where:
  Script 'C:\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1005
  
  * What went wrong:
  Execution failed for task ':app:compileFlutterBuildDebug'.
  &gt; 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 3m 33s
  Exception: Gradle task assembleDebug failed with exit code 1
  </code></pre>
  <p>I have tried the following with no help.</p>
  <pre><code>flutter channel stable
  flutter upgrade --force
  flutter pub cache repair
  flutter clean
  </code></pre>
  <p>in case anyone can help.</p>