简体   繁体   English

在Mac OS上安装Flutter

[英]Installing Flutter on Mac OS

on running flutter doctor i get the below dependency lacking : 在运行扑医生时,我缺少以下依赖项:

Android toolchain - develop for Android devices (Android SDK 28.0.3)
     Could not determine java version
Android Studio (not installed)

But i have already installed both and developing apps on Android Studio.Then why flutter is not able to find these two? 但是我已经在Android Studio上安装了这两个程序并正在开发应用程序。那么为什么flutter找不到这两个?

It is complaining for the jre version as well.But internally Android Studio uses the jre which is already installed with it. 它也抱怨jre版本。但是Android Studio内部使用已经安装的jre。

flutter doctor -v gives below output : flutter doctor -v给出以下输出:

[✓] Flutter (Channel stable, v1.0.0, on Mac OS X 10.13.6 17G65, locale en-IN)
    • Flutter version 1.0.0 at /Users/<myusername>/Downloads/development/flutter
    • Framework revision 5391447fae (3 months ago), 2018-11-29 19:41:26 -0800
    • Engine revision 7375a0f414
    • Dart version 2.1.0 (build 2.1.0-dev.9.4 f9ebf21297)

[!] Android toolchain - develop for Android devices (Android SDK 28.0.3)
    • Android SDK at /Users/<myusername>/Library/Android/sdk
    • Android NDK at /Users/<myusername>/Library/Android/sdk/ndk-bundle
    • Platform android-28, build-tools 28.0.3
    • Java binary at: /usr/bin/java
    ✗ Could not determine java version

[!] iOS toolchain - develop for iOS devices
    ✗ Xcode installation is incomplete; a full installation is necessary for iOS development.
      Download at: https://developer.apple.com/xcode/download/
      Or install Xcode via the App Store.
      Once installed, run:
        sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
    • ios-deploy 1.9.4
    • CocoaPods version 1.6.0

[!] Android Studio (not installed)
    • Android Studio not found; download from https://developer.android.com/studio/index.html
      (or visit https://flutter.io/setup/#android-setup for detailed instructions).

[!] Connected device
    ! No devices available

Solution for Xcode: Xcode解决方案:

Install Xcode (get it from https://developer.apple.com/xcode/ ) 安装Xcode(从https://developer.apple.com/xcode/获得)

Ensure Xcode app is in the /Applications directory (NOT /Users/{user}/Applications). 确保Xcode应用程序位于/ Applications目录中(不是/ Users / {user} / Applications)。

Point xcode-select to the Xcode app Developer directory using the following command: sudo xcode-select -s /Applications/Xcode.app/Contents/Developer 使用以下命令将xcode-select指向Xcode app Developer目录:sudo xcode-select -s /Applications/Xcode.app/Contents/Developer

Note: Make sure your Xcode app path is correct. 注意:确保您的Xcode应用程序路径正确。

Xcode: /Applications/Xcode.app/Contents/Developer Xcode-beta: /Applications/Xcode-beta.app/Contents/Developer Xcode:/Applications/Xcode.app/Contents/Developer Xcode-beta:/Applications/Xcode-beta.app/Contents/Developer

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM