gpt4 book ai didi

flutter - 启动后台服务导致Dart Error : Can't load Kernel binary: Invalid kernel binary: Indicated size is invalid

转载 作者:行者123 更新时间:2023-12-05 07:17:34 27 4
gpt4 key购买 nike

我刚刚升级flutter到最新版本,flutter doctor -v提示没有错误。从 Android Studio 安装 apk 时日志输出的错误部分看起来像这样:

Running Gradle task 'assembleDebug'...
✓ Built build/app/outputs/apk/debug/app-debug.apk.
E/flutter (24489): [ERROR:flutter/shell/common/shell.cc(197)] Dart Error: Can't load Kernel binary: Invalid kernel binary: Indicated size is invalid.
E/flutter (24489): [ERROR:flutter/shell/common/engine.cc(198)] Could not prepare to run the isolate.
E/flutter (24489): [ERROR:flutter/shell/common/engine.cc(137)] Engine not prepare and launch isolate.
E/flutter (24489): [ERROR:flutter/shell/common/shell.cc(433)] Could not launch engine with configuration.

I/zygote64(24489): Do full code cache collection, code=124KB, data=87KB
I/zygote64(24489): After code cache collection, code=116KB, data=66KB

我试图删除 flutter bin/cache GitHub issue page 建议, 和 flutter doctor再次,但这不能解决Dart Error:Invalid kernel binary: Indicated size is invalid问题。还有我的flutter channelmaster stable .顺便说一句,这个does always发生了,当第一次尝试运行失败时,第二次尝试运行可以绕过这些错误,只是无法弄清楚原因。

第一次编辑

关于Dart Error: Can't load Kernel binary: Invalid kernel binary: Indicated size is invalid的信息太少了.这不是kernel format 上的问题, 但关于 kernel size 的问题,有没有地方可以调整 flutter Dart 引擎的配置?

第二次编辑

这是我的 pubspec.yaml <罢工>

<罢工>
environment:
sdk: ">=2.1.0 <3.0.0"

dependencies:
flutter:
sdk: flutter

# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.2
intl: ^0.15.7
provider: ^3.1.0
shrine_images: ^1.0.0
url_launcher: 5.1.0
path_provider: ^1.2.0
barcode_scan: ^1.0.0
qr_flutter: ^1.1.1
font_awesome_flutter: ^8.5.0
flutter_circular_slider: ^2.5.0
flutter_swiper: ^1.1.6
after_layout: ^1.0.7+2
wave:


crypto: ^2.1.2
rxdart: ^0.22.2

bloc: ^0.15.0
flutter_bloc: ^0.21.0
equatable: ^0.2.0
json_serializable: ^3.2.2
shared_preferences: ^0.5.3+4
flutter_slidable: ^0.5.4
fluttertoast: ^3.1.3

encrypt: ^3.3.1
connectivity: ^0.4.4
animator: ^1.0.0+1

imei_plugin: ^1.1.4
photo_view: ^0.7.0


dev_dependencies:
flutter_test:
sdk: flutter
pedantic: ^1.4.0
build_runner: ^1.6.9

apk 可以在我push时安装 RunAndroid Studio 中按两次上面提到的绕过错误的接口(interface),但是当我将它分发给其他人时,该apk无法正常工作,它只是弹出一个白屏,没有其他任何东西。

第三次编辑

我在这个 GitHub Issue中也参与了讨论.

第四次编辑

我创建了一个最小 project重现这里的issues(暂时只关注 android platform),同时新开一个flutter issue .

第五次编辑

因为我引用了不同于 Firebase Cloud Messaging 的第三方库提供后台推送通知服务。我想 Dart Error: Can't load Kernel binary: Invalid kernel binary: Indicated size is invalid. 是由该服务引起的。当我注释掉启动它的行时,没有显示任何错误。最小值 project重现此问题也已相应更新。

最佳答案

我遇到了同样的问题,通过删除缓存文件夹并重新安装 flutter 解决了这个问题。

rm -rf ${FLUTTER_ROOT}/bin/cache

关于flutter - 启动后台服务导致Dart Error : Can't load Kernel binary: Invalid kernel binary: Indicated size is invalid,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58742377/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com