Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get an 'Unexpected Kernel SDK Version'-error when running flutter project in android studio

When I compile my flutter project in android studio for sdk x86 arm (mobile) i suddenly get this error below. Everything has worked fine untill now. Yesterday I upgraded flutter to newest version and there was no problems compiling the project after that. But suddenly today I get this error out of no where. Any idea what has happend? And what to do now?

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.

this is the output of 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!
like image 212
jeffmayn Avatar asked Jun 05 '26 12:06

jeffmayn


2 Answers

I had a similar issue, was able to fix it by just deleting the cache folder in flutter/bin and then running flutter doctor.

like image 91
Lavan Vivek Avatar answered Jun 07 '26 23:06

Lavan Vivek


I solve this with CMD and type "choco upgrade dart-sdk"

like image 22
Bagoes Dharma Jaya Avatar answered Jun 07 '26 22:06

Bagoes Dharma Jaya



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!