[Flutter][APK]Dart snapshot generator failed with exit code -9 - android

I had a Flutter app that was working just fine until today. I realized that the flutter build apk --release wasn't building the Flutter app with the latest code. Looked up on the internet. Did a flutter clean. Then flutter pub get. And then built the app again with flutter build apk --release. The following is the error I'm getting,
Current flutter version: 2.10.4
💪 Building with sound null safety 💪
Dart snapshot generator failed with exit code -9
Dart snapshot generator failed with exit code -9
FAILURE: Build failed with an exception.
* Where:
Script '/Users/exaltaretechnologiespvtltd./flutter/packages/flutter_tools/gradle/flutter.gradle' line: 1102
* What went wrong:
Execution failed for task ':app:compileFlutterBuildRelease'.
> Process 'command '/Users/exaltaretechnologiespvtltd./flutter/bin/flutter'' 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 49s
Running Gradle task 'assembleRelease'... 50.3s
Gradle task assembleRelease failed with exit code 1

Related

I am trying to build an Android apk for google play console. When I run

FAILURE: Build failed with an exception.
Where:
Script 'C:\src\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1156
What went wrong:
Execution failed for task ':app:compileFlutterBuildRelease'.
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 1m 45s
Running Gradle task 'assembleRelease'... 107.3s
Gradle task assembleRelease failed with exit code 1
PS C:\Users\Admin\Downloads\ct\gorun\gitlab\apps\wazeto-user>
tried flutter clean, flutter pub get this didn't worked. then i went for flutter pub upgrade --major-versions ... still shows the same error after flutter build apk
that happens sometimes because some issues wrong in the flutter sdk try to download the sdk again and replase with the current. or toggle the version with the FVM tool.
it will build with you and if you use for example 2.10.0 you can use also 2.10.3 it also will work.

Flutter build apk error - Execution failed for task ':app:compileFlutterBuildRelease'

I am trying to build an android apk, when I run the app or flutter build apk the following error occurs, i'm using flutter 3.0.5.
💪 Building with sound null safety 💪
FAILURE: Build failed with an exception.
* Where:
Script '/Users/edgar/Documents/tools/flutter-35/packages/flutter_tools/gradle/flutter.gradle' line: 1156
* What went wrong:
Execution failed for task ':app:compileFlutterBuildRelease'.
> Process 'command '/Users/edgar/Documents/tools/flutter-35/bin/flutter'' 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 45s
Running Gradle task 'assembleRelease'... 47,0s
Gradle task assembleRelease failed with exit code 1

Codepoint 984652 not found in font Flutter

Building with sound null safety
Codepoint 984652 not found in font, aborting.
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:compileFlutterBuildRelease'.
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 41s
Running Gradle task 'assembleRelease'... 46.1s
Gradle task assembleRelease failed with exit code 1
try building your application with this flutter build apk --no-tree-shake-icons
There is an issue with icons in Flutter 2.10.0 which causes this error. I am assuming that you are using 2.10.0 version of Flutter.
This issue is resolved in Flutter 2.10.2. So, run Flutter upgrade in the terminal to solve the problem.

Dart snapshot generator failed with exit code -6

I am trying to make a Android build from Android studio for flutter app but getting below error. How can I resolve the issue?
Current flutter version: 2.10.2
💪 Building with sound null safety 💪
../../third_party/dart/runtime/vm/compiler/aot/precompiler.cc: 3298: error: unreachable code
Dart snapshot generator failed with exit code -6
../../third_party/dart/runtime/vm/compiler/aot/precompiler.cc: 3298: error: unreachable code
Dart snapshot generator failed with exit code -6
../../third_party/dart/runtime/vm/compiler/aot/precompiler.cc: 3298: error: unreachable code
Dart snapshot generator failed with exit code -6
FAILURE: Build failed with an exception.
* Where:
Script '/Users/admin/Desktop/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 1102
* What went wrong:
Execution failed for task ':app:compileFlutterBuildRelease'.
> Process 'command '/Users/admin/Desktop/flutter/bin/flutter'' 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 39s
Running Gradle task 'assembleRelease'... 40.0s
Gradle task assembleRelease failed with exit code 1
Seems it was vm issue. There was some functions written in main.dart file and some of them was taking lot of memory. So I found solution by applying
#pragma('vm:never-inline')
above the functions which was taking memory.
I found those functions with running command flutter build apk --verbose

Flutter build error in "flutter build appbundle" command

Can't load Kernel binary: Invalid kernel binary format version.
Dart snapshot generator failed with exit code 254
Can't load Kernel binary: Invalid kernel binary format version.
Can't load Kernel binary: Invalid kernel binary format version.
Dart snapshot generator failed with exit code 254
Dart snapshot generator failed with exit code 254
FAILURE: Build failed with an exception.
* Where:
Script 'C:\src\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1035
* What went wrong:
Execution failed for task ':app:compileFlutterBuildRelease'.
> 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 7s
Running Gradle task 'bundleRelease'...
Running Gradle task 'bundleRelease'... Done 9.6s
Gradle task bundleRelease failed with exit code 1
when I try to run flutter build appbundle --no-sound-null-safety command than this error come. What is the solution for it?
Try these commands and try again:
flutter create .
flutter clean
flutter pub get

Categories

Resources