[英]Device not applicable for the “main.dart” configuration
Before anyone points me to this link I would like to mention, that I don't think these are directly related.在有人向我指出此链接之前,我想提一下,我认为这些没有直接关系。
As one can see my flutter doctor -v
command is error free:可以看到我的
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!
Yet I to have the issue of a grayed out emulator device with the message Device not applicable for the “main.dart” configuration
like this:然而,我遇到了一个灰色的仿真器设备问题,消息
Device not applicable for the “main.dart” configuration
,如下所示:
I can now only start the emulator using the dropdown menu <no device>
like this:我现在只能使用下拉菜单
<no device>
启动模拟器,如下所示:
Interestingly I am then actually able to run my app on the device, while the device is still grayed out:有趣的是,我实际上能够在设备上运行我的应用程序,而设备仍然是灰色的:
Flutters hot-reloading feature seems to not work properly though.不过,Flutters 的热重载功能似乎无法正常工作。
I have already added the main folder to the project as suggested here and I also made sure to change NO SDK
to ANDROID API PLATFORM
as suggested in the same link.我已经按照此处的建议将主文件夹添加到项目中,并且我还确保按照同一链接中的建议将
NO SDK
更改为ANDROID API PLATFORM
。 All dependencies in Project Structure > Modules
are found by Android Studio. Project Structure > Modules
中的所有依赖项均由 Android Studio 找到。 I cloned the Flutter SKD from the stable branch on GitHub .我从 GitHub 上的稳定分支克隆了Flutter SKD。
Does anyone have an idea why my setup is behaving this way?有谁知道为什么我的设置会这样?
It solved my problem:它解决了我的问题:
1- Make sure Flutter plugin is installed in android studio, you can install the plugin from file > setting > plugin 1-确保Flutter插件安装在android studio中,您可以从文件>设置>插件安装插件
2- choose flutter SDK path from File > setting> Language & Framework > flutter. 2- 从文件 > 设置 > 语言和框架 > flutter 中选择 flutter SDK 路径。
Close Android Studio and Run again as Administrator关闭Android Studio并再次以管理员身份运行
I have the same issue before.我以前也有同样的问题。
Hopefully worked for you.希望对你有用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.