Flutter

M1 的 Mac 安装 Flutter 报错 Unable to

2021-07-26  本文已影响0人  九九丸子
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.2.3, on macOS 11.3.1 20E241 darwin-arm, locale
    zh-Hans-CN)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[✓] Xcode - develop for iOS and macOS
[✓] Chrome - develop for the web
[!] Android Studio
    ✗ Unable to find bundled Java version.
[✓] VS Code (version 1.58.2)
[✓] Connected device (1 available)

解决办法:

第一步在这个文件里flutter/packages/flutter_tools/lib/src/android/android_studio.dart
把globals.fs.path.join(directory, 'jre', 'jdk', 'Contents', 'Home') :替换成globals.fs.path.join(directory, 'jre', 'Contents', 'Home') ,就是去掉jdk。

然后在android studio preview.app的包中把/Applications/Android Studio Preview.app/Contents/jre/Contents中的文件copy到/Applications/Android Studio Preview.app/Contents/jre/jdk/Contents中。

参考自:
https://blog.csdn.net/wh5359/article/details/118895172

上一篇 下一篇

猜你喜欢

热点阅读