android - 在 Mac OS 上安装 Flutter
问题描述
在运行颤振医生时,我得到以下依赖项:
Android toolchain - develop for Android devices (Android SDK 28.0.3)
Could not determine java version
Android Studio (not installed)
但是我已经在Android Studio上安装并开发了应用程序。那为什么flutter找不到这两个呢?
它也在抱怨 jre 版本。但在内部,Android Studio 使用已经安装的 jre。
颤振医生 -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
解决方案
Xcode 的解决方案:
安装 Xcode(从https://developer.apple.com/xcode/获取)
确保 Xcode 应用程序位于 /Applications 目录中(不是 /Users/{user}/Applications)。
使用以下命令将 xcode-select 指向 Xcode 应用开发者目录:sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
注意:确保您的 Xcode 应用程序路径正确。
Xcode:/Applications/Xcode.app/Contents/Developer Xcode-beta:/Applications/Xcode-beta.app/Contents/Developer
推荐阅读
- javascript - Google App Scripts 在电子表格中查找文本并返回位置索引
- graphql - 如何强制服务器端的过滤器到 graphql 查询?
- python - 熊猫操纵合并的 DF 以解决聚合问题
- spring-boot - 如何从自定义 Webclient Builder 获取 webflux webClient 指标
- xamarin.forms - 仍然收到 ITMS-90809:使用 --optimize=force-rejected-types-removal 后已弃用的 API 使用
- reactjs - 如何让我部署的 Web 应用程序找到我的静态文件?
- programming-languages - 寻找跨平台语言
- python - 哪个数据库可以容纳一种类型的数据的巨大列表?
- python-3.x - 找不到任何pip2,要使用pip。pip 需要安装
- javascript - 如何知道数组中的最后一个对象?角度(角度材料选项卡)