【发布时间】:2020-05-05 12:26:12
【问题描述】:
在有人将我指向 this link 之前,我想提一下,我认为这些没有直接关系。
可以看到我的flutter doctor -v 命令没有错误:
➜ flutter git:(stable) flutter doctor -v
[✓] Flutter (Channel stable, v1.12.13+hotfix.9, on Mac OS X 10.15.3 19D76, locale en-US)
• Flutter version 1.12.13+hotfix.9 at /Users/johannes/.flutter-cli/flutter
• Framework revision f139b11009 (5 weeks ago), 2020-03-30 13:57:30 -0700
• Engine revision af51afceb8
• Dart version 2.7.2
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
• Android SDK at /Users/johannes/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-29, build-tools 29.0.3
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 11.4.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 11.4.1, Build version 11E503a
• CocoaPods version 1.8.4
[✓] Android Studio (version 3.6)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 45.1.1
• Dart plugin version 192.7761
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)
[✓] Connected device (1 available)
• Android SDK built for x86 • emulator-5554 • android-x86 • Android 10 (API 29) (emulator)
• No issues found!
但我遇到了一个灰色的仿真器设备问题,消息为Device not applicable for the “main.dart” configuration,如下所示:
我现在只能使用下拉菜单<no device> 启动模拟器,如下所示:
有趣的是,我实际上可以在设备上运行我的应用程序,而设备仍然是灰色的:
Flutters 的热重载功能似乎无法正常工作。
我已经按照here 的建议将主文件夹添加到项目中,并且我还确保按照同一链接中的建议将NO SDK 更改为ANDROID API PLATFORM。 Project Structure > Modules 中的所有依赖项都由 Android Studio 找到。我从GitHub 上的稳定分支克隆了 Flutter SKD。
有人知道为什么我的设置会这样吗?
【问题讨论】:
-
不,遗憾的是没有。我实际上在我的问题的第一句话中链接了这个问题。我已经尝试了几乎所有在 stackoverflow 上找到的东西。
flutter doctor也不会返回如上所示的错误。工具链似乎不是问题。
标签: android android-studio flutter android-emulator