Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hook 不生效,无法生成.dill.txt文件 #5

Closed
junlandroid opened this issue Jan 24, 2022 · 2 comments
Closed

hook 不生效,无法生成.dill.txt文件 #5

junlandroid opened this issue Jan 24, 2022 · 2 comments

Comments

@junlandroid
Copy link

No description provided.

@junlandroid
Copy link
Author

如题:
/Users/yuan/.zshrc:source:16: no such file or directory: /usr/local/opt/fvm/init.sh
yuan@yuanjunliangdeMacBook-Pro ~ % /Users/yuan/fvm/versions/2.5.3/bin/cache/dart-sdk/bin/dart /Users/yuan/Documents/sdk/pkg/vm/bin/dump_kernel.dart /Users/yuan/Documents/workspace/Beike_AspectD/example/.dart_tool/flutter_build/b191e02b123d4ac16c1734a562ab3ea3/app.dill /Users/yuan/Documents/workspace/Beike_AspectD/example/.dart_tool/flutter_build/b191e02b123d4ac16c1734a562ab3ea3/app.dill.txt
Unhandled exception:
Unexpected Kernel Format Version 69 (expected 46).
#0 BinaryBuilder.readComponent. (package:kernel/binary/ast_from_binary.dart:531:9)
#1 Timeline.timeSync (dart:developer/timeline.dart:163:22)
#2 BinaryBuilder.readComponent (package:kernel/binary/ast_from_binary.dart:518:21)
#3 main (file:///Users/yuan/Documents/sdk/pkg/vm/bin/dump_kernel.dart:56:40)
#4 _delayEntrypointInvocation. (dart:isolate-patch/isolate_patch.dart:281:32)
#5 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:184:12)

在上面命令中,项目中应该用的是flutter 目录下的sdk,而/Users/yuan/Documents/sdk/pkg/vm/bin/dump_kernel.dart 这个路径指的是哪个?

环境:
`yuan@deMacBook-Pro ~ % fvm flutter doctor -v
[✓] Flutter (Channel stable, 2.5.3, on macOS 11.4 20F71 darwin-arm, locale zh-Hans-CN)
• Flutter version 2.5.3 at /Users/yuan/Documents/flutter-2.5.3/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 18116933e7 (3 months ago), 2021-10-15 10:46:35 -0700
• Engine revision d3ea636dc5
• Dart version 2.14.4
• Pub download mirror https://pub.flutter-io.cn
• Flutter download mirror https://storage.flutter-io.cn

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
• Android SDK at /Users/yuan/Library/Android/sdk
• Platform android-31, build-tools 31.0.0
• Java binary at: /Library/Java/JavaVirtualMachines/temurin-8.jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (Temurin)(build 1.8.0_302-b08)
• All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 13.1, Build version 13A1030d
• CocoaPods version 1.11.2

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

[!] Android Studio
• Android Studio at /Applications/Android Studio Preview 2.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
✗ Unable to find bundled Java version.
• Try updating or re-installing Android Studio.

[✓] VS Code (version 1.63.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.32.0

[✓] Connected device (2 available)
• Android SDK built for arm64 (mobile) • emulator-5554 • android-arm64 • Android 10 (API 29) (emulator)
• Chrome (web) • chrome • web-javascript • Google Chrome 97.0.4692.99

! Doctor found issues in 1 category.
yuan@MacBook-Pro ~ % `

@junlandroid junlandroid reopened this Jan 24, 2022
@junlandroid junlandroid changed the title hook hook 不生效,无法生成.dill.txt文件 Jan 24, 2022
@soloxiao
Copy link
Collaborator

如题: /Users/yuan/.zshrc:source:16: no such file or directory: /usr/local/opt/fvm/init.sh yuan@yuanjunliangdeMacBook-Pro ~ % /Users/yuan/fvm/versions/2.5.3/bin/cache/dart-sdk/bin/dart /Users/yuan/Documents/sdk/pkg/vm/bin/dump_kernel.dart /Users/yuan/Documents/workspace/Beike_AspectD/example/.dart_tool/flutter_build/b191e02b123d4ac16c1734a562ab3ea3/app.dill /Users/yuan/Documents/workspace/Beike_AspectD/example/.dart_tool/flutter_build/b191e02b123d4ac16c1734a562ab3ea3/app.dill.txt Unhandled exception: Unexpected Kernel Format Version 69 (expected 46). #0 BinaryBuilder.readComponent. (package:kernel/binary/ast_from_binary.dart:531:9) #1 Timeline.timeSync (dart:developer/timeline.dart:163:22) #2 BinaryBuilder.readComponent (package:kernel/binary/ast_from_binary.dart:518:21) #3 main (file:///Users/yuan/Documents/sdk/pkg/vm/bin/dump_kernel.dart:56:40) #4 _delayEntrypointInvocation. (dart:isolate-patch/isolate_patch.dart:281:32) #5 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:184:12)

在上面命令中,项目中应该用的是flutter 目录下的sdk,而/Users/yuan/Documents/sdk/pkg/vm/bin/dump_kernel.dart 这个路径指的是哪个?

环境: `yuan@deMacBook-Pro ~ % fvm flutter doctor -v [✓] Flutter (Channel stable, 2.5.3, on macOS 11.4 20F71 darwin-arm, locale zh-Hans-CN) • Flutter version 2.5.3 at /Users/yuan/Documents/flutter-2.5.3/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 18116933e7 (3 months ago), 2021-10-15 10:46:35 -0700 • Engine revision d3ea636dc5 • Dart version 2.14.4 • Pub download mirror https://pub.flutter-io.cn • Flutter download mirror https://storage.flutter-io.cn

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0) • Android SDK at /Users/yuan/Library/Android/sdk • Platform android-31, build-tools 31.0.0 • Java binary at: /Library/Java/JavaVirtualMachines/temurin-8.jdk/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (Temurin)(build 1.8.0_302-b08) • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS • Xcode at /Applications/Xcode.app/Contents/Developer • Xcode 13.1, Build version 13A1030d • CocoaPods version 1.11.2

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

[!] Android Studio • Android Studio at /Applications/Android Studio Preview 2.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 ✗ Unable to find bundled Java version. • Try updating or re-installing Android Studio.

[✓] VS Code (version 1.63.2) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.32.0

[✓] Connected device (2 available) • Android SDK built for arm64 (mobile) • emulator-5554 • android-arm64 • Android 10 (API 29) (emulator) • Chrome (web) • chrome • web-javascript • Google Chrome 97.0.4692.99

! Doctor found issues in 1 category. yuan@MacBook-Pro ~ % `

Unexpected Kernel Format Version 69 (expected 46)
上面这个错误可能是由于/Users/yuan/Documents/sdk你这个目录定的sdk和你Flutter使用的dart SDK不对应

解决方案
打开flutter/bin/cache/dart-sdk/revision,复制其中的commitid,将/Users/yuan/Documents/sdk切换到对应的commit,再尝试使用dump_kernel.dart 进行解析。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants