为什么flutter会在同一位置报告Android Studio的有效安装和无效安装?遇到的错误如下:
Sat Dec 1 10:52:34 AEDT 2018
flutter_app $ flutter doctor -v
[✓] Flutter (Channel beta, v0.11.12, on Linux, locale en_AU.UTF-8)
• Flutter version 0.11.12 at /home/jedaa/bin/flutter
• Framework revision 06ec8d3b41 (2 days ago), 2018-11-28 15:56:58 -0800
• Engine revision 72c7a75672
• 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 /home/jedaa/bin/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-28, build-tools 28.0.3
• ANDROID_HOME = /home/jedaa/bin/Android/sdk
• Java binary at: /home/jedaa/bin/android-studio/jre/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)
• All Android licenses accepted.
[✓] Android Studio (version 3.2)
• Android Studio at /home/jedaa/bin/android-studio
• Flutter plugin version 31.1.1
• Dart plugin version 181.5656
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)
[✓] Android Studio
• Android Studio at /home/jedaa/bin/android-studio/
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
• android-studio-dir = /home/jedaa/bin/android-studio/
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)
[✓] IntelliJ IDEA Community Edition (version 2018.3)
• IntelliJ at /opt/idea
• Flutter plugin version 31.1.4
• Dart plugin version 183.4733
[✓] VS Code (version 1.29.1)
• VS Code at /usr/share/code
• Flutter extension version 2.21.0
[!] Connected device
! No devices available
当我加载AS并运行默认应用程序..我在事件日志中得到这个:
10:51 AM Unable to list devices: Unable to discover Android devices.
Please run "flutter doctor" to diagnose potential issues
11:13 AM Emulator: Couldn't statvfs() path: No such file or directory
11:13 AM Emulator: qemu-system-x86_64: warning: host doesn't support
requested feature: CPUID.80000001H:ECX.abm [bit 5]
你能帮忙解决这个问题吗,谢谢。
这个问题是由以下两个扑动命令解决的! ...
flutter config --android-sdk /path/to/android/sdk
flutter config --android-studio-dir /path/to/android/studio
我建议清除android-studio-dir和android-sdk设置,让flutter自动检测它们的路径:
$ flutter config --android-studio-dir=""
Removing "android-studio-dir" value.
$ flutter config --android-sdk=""
Removing "android-sdk" value.
使用以前版本的Android Studio的配置文件删除文件夹解决了我的问题。更新后我有两个版本的Android Studio。
.AndroidStudio3.3
.AndroidStudio3.4
所以我删除了3.3版(.AndroidStudio3.3)的配置文件,只保留了3.4版的配置文件(.AndroidStudio3.4)
如果您是Ubuntu用户并且为Android Studio执行了默认安装,则可以在主目录中找到这些文件夹。这些文件夹是隐藏的,因此您必须先取消隐藏它们。
确保在更新后出现提示时导入以前的设置,否则在删除旧配置文件之前必须重新安装所有依赖项。