Flutter doctor如何检测两个不同的Flutter版本
How does Flutter doctor detects two differenct Flutter versions
我正在尝试 运行 在 Android studio 上运行我的 Flutter 应用程序,但是当我点击相关按钮时收到 E/flutter (25907): [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: MissingPluginException(No implementation found for method getStorageDirectory on channel plugins.flutter.io/path_provider)
警告。
在 Android Studio 上,我启用了 Flutter 和 Dart 插件,当我 运行 flutter doctor -v
时,我看到了这个输出:
[✓] Flutter (Channel dev, 2.10.0-0.3.pre, on Ubuntu 20.04.3 LTS 5.13.0-28-generic, locale en_CA.UTF-8)
• Flutter version 2.10.0-0.3.pre at /root/snap/flutter/common/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision fdd0af78bb (10 days ago), 2022-01-25 22:01:33 -0600
• Engine revision 5ac30ef0c7
• Dart version 2.16.0 (build 2.16.0-134.5.beta)
• DevTools version 2.9.2
[✓] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
• Android SDK at /root/Android/Sdk
• Platform android-31, build-tools 32.1.0-rc1
• Java binary at: PATH TO android-studio/jre/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
• All Android licenses accepted.
[✓] Chrome - develop for the web
• Chrome at google-chrome
[✓] Android Studio (version 4.1)
• Android Studio at PATH TO android-studio
• Flutter plugin version 57.0.1
• Dart plugin version 201.9380
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
[✓] Connected device (2 available)
• SM T860 (mobile) • R52MB1MGD5H • android-arm64 • Android 11 (API 30)
• Chrome (web) • chrome • web-javascript • Google Chrome 92.0.4515.159
[✓] HTTP Host Availability
• All required HTTP hosts are available
所以我看到 Flutter/Dart
的两个不同版本,如 2.10.0-0.3.pre/2.16.0
和 57.0.1/201.9380
。这怎么可能,我该如何预防?
谢谢
那不是 Flutter,那是 Android Studio 的 Flutter 插件。完全是两种不同的东西。 Android Studio 中有一个扩展页面,您需要从该页面下载 Flutter 扩展。你做到了。
• Flutter 插件版本 57.0.1
这显示该扩展的版本,而不是 Flutter 的版本。
此扩展可帮助您在 Android Studio 上进行编码,添加对 Flutter 的支持。与Flutter SDK无关
Android Studio 扩展页面:
我正在尝试 运行 在 Android studio 上运行我的 Flutter 应用程序,但是当我点击相关按钮时收到 E/flutter (25907): [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: MissingPluginException(No implementation found for method getStorageDirectory on channel plugins.flutter.io/path_provider)
警告。
在 Android Studio 上,我启用了 Flutter 和 Dart 插件,当我 运行 flutter doctor -v
时,我看到了这个输出:
[✓] Flutter (Channel dev, 2.10.0-0.3.pre, on Ubuntu 20.04.3 LTS 5.13.0-28-generic, locale en_CA.UTF-8)
• Flutter version 2.10.0-0.3.pre at /root/snap/flutter/common/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision fdd0af78bb (10 days ago), 2022-01-25 22:01:33 -0600
• Engine revision 5ac30ef0c7
• Dart version 2.16.0 (build 2.16.0-134.5.beta)
• DevTools version 2.9.2
[✓] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
• Android SDK at /root/Android/Sdk
• Platform android-31, build-tools 32.1.0-rc1
• Java binary at: PATH TO android-studio/jre/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
• All Android licenses accepted.
[✓] Chrome - develop for the web
• Chrome at google-chrome
[✓] Android Studio (version 4.1)
• Android Studio at PATH TO android-studio
• Flutter plugin version 57.0.1
• Dart plugin version 201.9380
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
[✓] Connected device (2 available)
• SM T860 (mobile) • R52MB1MGD5H • android-arm64 • Android 11 (API 30)
• Chrome (web) • chrome • web-javascript • Google Chrome 92.0.4515.159
[✓] HTTP Host Availability
• All required HTTP hosts are available
所以我看到 Flutter/Dart
的两个不同版本,如 2.10.0-0.3.pre/2.16.0
和 57.0.1/201.9380
。这怎么可能,我该如何预防?
谢谢
那不是 Flutter,那是 Android Studio 的 Flutter 插件。完全是两种不同的东西。 Android Studio 中有一个扩展页面,您需要从该页面下载 Flutter 扩展。你做到了。
• Flutter 插件版本 57.0.1
这显示该扩展的版本,而不是 Flutter 的版本。
此扩展可帮助您在 Android Studio 上进行编码,添加对 Flutter 的支持。与Flutter SDK无关
Android Studio 扩展页面: