gpt4 book ai didi

flutter - 在 android studio 中运行 flutter 项目时出现 'Unexpected Kernel SDK Version' 错误

转载 作者:行者123 更新时间:2023-12-02 18:47:17 56 4
gpt4 key购买 nike

当我在 android studio 中为 sdk x86 arm(移动)编译我的 flutter 项目时,我突然在下面收到此错误。到现在为止一切正常。昨天我将 flutter 升级到最新版本,之后编译项目没有问题。但是今天突然间我不知从哪里得到了这个错误。知道发生了什么吗?现在该怎么办?

Launching lib/main.dart on sdk gphone x86 arm in debug mode...
Running Gradle task 'assembleDebug'...
Unhandled exception:
Unexpected Kernel SDK Version 72c1995001 (expected 7c8c6b3053).
#0 BinaryBuilder._readAndVerifySdkHash (package:kernel/binary/ast_from_binary.dart:523:7)
#1 BinaryBuilder.readComponent.<anonymous closure> (package:kernel/binary/ast_from_binary.dart:555:7)
#2 Timeline.timeSync (dart:developer/timeline.dart:163:22)
#3 BinaryBuilder.readComponent (package:kernel/binary/ast_from_binary.dart:539:21)
#4 IncrementalCompiler.prepareSummary (package:front_end/src/fasta/incremental_compiler.dart:1647:12)
#5 IncrementalCompiler.ensurePlatformAndInitialize (package:front_end/src/fasta/incremental_compiler.dart:1138:23)
<asynchronous suspension>
#6 IncrementalCompiler.computeDelta.<anonymous closure> (package:front_end/src/fasta/incremental_compiler.dart:229:11)
<asynchronous suspension>
#7 IncrementalCompiler.compile (package:vm/incremental_compiler.dart:69:29)
<asynchronous suspension>
#8 FrontendCompiler.compile (package:frontend_server/frontend_server.dart:509:11)
<asynchronous suspension>
#9 listenAndCompile.<anonymous closure> (package:frontend_server/frontend_server.dart:1105:11)
<asynchronous suspension>
the Dart compiler exited unexpectedly.
the Dart compiler exited unexpectedly.

这是 flutter doctor 的输出:

/Users/thanos/Desktop/Development/flutter_2_0_1/bin/flutter doctor --verbose
[✓] Flutter (Channel stable, 2.0.5, on macOS 11.2.3 20D91 darwin-x64, locale da-DK)
• Flutter version 2.0.5 at /Users/thanos/Desktop/Development/flutter_2_0_1
• Framework revision adc687823a (10 days ago), 2021-04-16 09:40:20 -0700
• Engine revision b09f014e96
• Dart version 2.12.3

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
• Android SDK at /Users/thanos/Library/Android/sdk
• Platform android-30, build-tools 30.0.3
• ANDROID_HOME = /Users/thanos/Library/Android/sdk
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
• All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.4, Build version 12D4e
• CocoaPods version 1.10.1

[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.1)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)

[✓] Connected device (2 available)
• sdk gphone x86 arm (mobile) • emulator-5554 • android-x86 • Android 11 (API 30) (emulator)
• Chrome (web) • chrome • web-javascript • Google Chrome 90.0.4430.85

• No issues found!

最佳答案

我有一个类似的问题,可以通过删除 flutter/bin 中的缓存文件夹然后运行 ​​flutter doctor 来修复它。

关于flutter - 在 android studio 中运行 flutter 项目时出现 'Unexpected Kernel SDK Version' 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67268972/

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