美文网首页Flutter
M1 的 Mac 安装 Flutter 报错 Unable to

M1 的 Mac 安装 Flutter 报错 Unable to

作者: 九九丸子 | 来源:发表于2021-07-26 15:16 被阅读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

    相关文章

      网友评论

        本文标题:M1 的 Mac 安装 Flutter 报错 Unable to

        本文链接:https://www.haomeiwen.com/subject/ahhgmltx.html