【发布时间】:2021-10-15 23:35:38
【问题描述】:
我希望以后能够添加 Android/iOS 版本。创建项目后添加 Android/iOS 支持似乎存在问题。
重现步骤
- 创建一个新的 Flutter 项目
- 仅启用网络
- 使用
flutter config --enable-android添加Android配置 - 我已尝试重新启动 Android Studio。运行
flutter clean、flutter pub get和flutter pub upgrade无效。
知道可能出了什么问题吗?我也尝试过四处搜索,但似乎找不到任何有关如何使其正常工作的文档。目前我能想到的唯一解决方法就是创建一个新的 Flutter 项目并从 lib/ 迁移现有代码
我目前正在使用 Android Studio 北极狐 2020.3.1
[✓] Flutter (Channel stable, 2.2.3, on macOS 11.5.1 20G80 darwin-x64, locale en)
• Flutter version 2.2.3
• Framework revision f4abaa0735 (6 weeks ago), 2021-07-01 12:46:11 -0700
• Engine revision 241c87ad80
• Dart version 2.13.4
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
• Android SDK
• Platform android-30, build-tools 30.0.2
• Java binary at: /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java
• Java version Java(TM) SE Runtime Environment (build 1.8.0_221-b11)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.0.1, Build version 12A7300
• CocoaPods version 1.10.0
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[!] Android Studio (version 2020.3)
• Android Studio at /Applications/Android Studio.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.59.0)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.25.0
[✓] Connected device (2 available)
• AOSP on IA Emulator (mobile) • emulator-5554 • android-x86 • Android 9 (API 28) (emulator)
• Chrome (web) • chrome • web-javascript • Google Chrome 92.0.4515.131
! Doctor found issues in 1 category.
【问题讨论】: