skip to Main Content

Target kernel_snapshot failed: Exception

FAILURE: Build failed with an exception.

  • Where:
    Script ‘C:flutterpackagesflutter_toolsgradlesrcmaingroovyflutter.groovy’ line: 1297

  • What went wrong:
    Execution failed for task ‘:app:compileFlutterBuildRelease’.

Process ‘command ‘C:flutterbinflutter.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 52m 55s
Running Gradle task ‘assembleRelease’… 3229.1s
Gradle task assembleRelease failed with exit code 1

Please how do i fix.

i tried runing this flutter build apk –split-per-abi –no-tree-shake-icons but same result, i also tried changing the complesdkversion.

2

Answers


  1. I had this similar kind of issue once. So for windows the openJDK platform binary is running in the background so end the task. Then go to .gradle > cache > then delete the folder the error is showing. After these steps the issue was resolved.(Cause of error: The file classes.jar got corrupted for some reason). Thank you.

    Login or Signup to reply.
  2. Sometimes the best things you have to do when encountered issue while building app etc

    Do below given steps:

    1. delete .gradle (located in Android folder)
    2. Flutter Clean
    3. Flutter Pub get

    Sometimes you have to delete pupspec.lock file
    or also see the stack trace if there are any minimum version SDK restrictions or try to update your gradle build version.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search