我有Flutter 0.5.1 beta,我试图用它运行hello world,但没有用 因此,我决定使用dev版本检查它是否仍然无法正常工作,请检查以下代码段以获取更多详细信息:
$~/StudioProjects/flutter/examples/hello_world$ flutter --version
Flutter 0.5.7 • channel dev • https://github.com/flutter/flutter.git
Framework • revision 66091f9696 (10 days ago) • 2018-07-09 12:52:41 -0700
Engine • revision 6fe748490d
Tools • Dart 2.0.0-dev.63.0.flutter-4c9689c1d2
$~/StudioProjects/flutter/examples/hello_world$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel dev, v0.5.7, on Linux, locale en_GB.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK 27.0.3)
[✓] Android Studio (version 3.1)
[✓] Android Studio (version 3.2)
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
[✓] Connected devices (1 available)
• No issues found!
$~/StudioProjects/flutter/examples/hello_world$ flutter run
Running "flutter packages get" in hello_world...
Because hello_world depends on flutter_test any from sdk which depends on watcher 0.9.7+8, watcher 0.9.7+8 is required.
So, because hello_world depends on watcher 0.9.7+9, version solving failed.
pub get failed (1)
当我尝试运行其他示例时,会发生以下情况:
$~/Flutter.0.5.7/examples/catalog$ flutter run
Running "flutter packages get" in catalog... 0.5s
Using hardware rendering with device Android SDK built for x86. If you get graphics artifacts, consider enabling software rendering with "--enable-software-rendering".
Launching lib/main.dart on Android SDK built for x86 in debug mode...
Initializing gradle... 1.2s
Resolving dependencies... 1.8s
Running 'gradlew assembleDebug'... 16.3s
Built build/app/outputs/apk/debug/app-debug.apk.
Installing build/app/outputs/apk/app.apk... 0.9s
D/ ( 7730): HostConnection::get() New Host Connection established 0xdc2a9bc0, tid 7750
D/EGL_emulation( 7730): eglMakeCurrent: 0xe6abd0a0: ver 2 0 (tinfo 0xdc2ff790)
Syncing files to device Android SDK built for x86... 3.3s
To hot reload changes while running, press "r". To hot restart (and rebuild state), press "R".
An Observatory debugger and profiler on Android SDK built for x86 is available at: http://X.X.X.X:XXXX/
For a more detailed help message, press "h". To quit, press "q".
答案 0 :(得分:0)
根据对问题的评论,在Flutter发行版未更新或您使用beta(稳定或金丝雀?)以外的频道时,示例可能无法正常工作 您可以执行此命令,看看它是否有效。
flutter channel beta #switch to beta channel
flutter packages get #update the packages?