Home > database >  Flutter build error in "flutter build appbundle" command
Flutter build error in "flutter build appbundle" command

Time:12-08

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?

CodePudding user response:

Something that work for me is: Delete your pubspec.lock, and press 'Pub Get' in your pubspec.yaml, it'll regenerate pubspec.lock file again and should fix the problem.

CodePudding user response:

Try these commands and try again:

flutter create .
flutter clean
flutter pub get
  • Related