【问题标题】:Flutter build error in "flutter build appbundle" command“flutter build appbundle”命令中的 Flutter 构建错误
【发布时间】:2022-01-13 02:02:02
【问题描述】:
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

当我尝试运行 flutter build appbundle --no-sound-null-safety 命令时,会出现此错误。有什么解决办法?

【问题讨论】:

  • 如果你想制作一个 app bundle,你可以使用 android studio,除了命令。

标签: android ios flutter gradle flutter-devtools


【解决方案1】:

对我有用的是:删除您的 pubspec.lock,然后在您的 pubspec.yaml 中按“Pub Get”,它将再次重新生成 pubspec.lock 文件并且应该可以解决问题。

【讨论】:

    【解决方案2】:

    尝试这些命令并重试:

    flutter create .
    flutter clean
    flutter pub get
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-12-14
      • 2021-11-04
      • 2020-08-24
      • 2021-09-06
      • 1970-01-01
      • 2021-12-14
      • 2022-01-11
      • 2023-01-14
      相关资源
      最近更新 更多