Flutter应用程序启动,只有白屏,奇数错误消息

时间:2018-06-11 22:13:19

标签: flutter

我正在尝试运行flutter create first_try创建的应用程序(我没有对代码进行任何更改)。

我正在运行高级sierra的Mac,Xcode 9.4。

如果我运行flutter run,它运行正常,并且在iOS模拟器中出现就好了。

如果我在IntelliJ下运行它,使用“运行”按钮(绿色三角形),它运行正常,但我不能进行热重新加载等。

如果我在IntelliJ下运行它,使用“debug”按钮(绿色错误),它会在模拟器中打开,但只显示白色屏幕。

我在IntelliJ窗口中收到以下消息:

Launching lib/main.dart on iPhone X in debug mode...
log: Must be admin to run 'stream' command
Script started, output file is /dev/null

Script done, output file is /dev/null
Starting Xcode build...
Xcode build done.

我尝试过运行flutter clean,但没有帮助。

以下是flutter doctor -v的输出:

$ flutter doctor -v
[✓] Flutter (Channel beta, v0.4.4, on Mac OS X 10.13.5 17F77, locale en-US)
    • Flutter version 0.4.4 at /Volumes/Second/Chris/hacks/flutter/flutter
    • Framework revision f9bb4289e9 (4 weeks ago), 2018-05-11 21:44:54 -0700
    • Engine revision 06afdfe54e
    • Dart version 2.0.0-dev.54.0.flutter-46ab040e58

[!] Android toolchain - develop for Android devices (Android SDK 28.0.0)
    • Android SDK at /Users/chris/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.0.0
    • Java binary at: /Users/chris/hacks/flutter/jdk-10.0.1.jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 10.0.1+10)
    ✗ Android license status unknown.

[✓] iOS toolchain - develop for iOS devices (Xcode 9.4)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 9.4, Build version 9F1027a
    • ios-deploy 1.9.2
    • CocoaPods version 1.5.3

[✗] Android Studio (not installed)
    • Android Studio not found; download from https://developer.android.com/studio/index.html
      (or visit https://flutter.io/setup/#android-setup for detailed instructions).

[✓] IntelliJ IDEA Community Edition (version 2018.1.4)
    • IntelliJ at /Users/chris/Applications/IntelliJ IDEA CE.app
    • Flutter plugin version 25.0.2
    • Dart plugin version 181.4892.1

[!] VS Code (version 1.24.0)
    • VS Code at /Users/chris/Applications/Visual Studio Code.app/Contents
    • Dart Code extension not installed; install from
      https://marketplace.visualstudio.com/items?itemName=Dart-Code.dart-code

[✓] Connected devices (1 available)
    • iPhone X • D34D5096-B3F9-4930-822B-48D3BD71B83D • ios • iOS 11.4 (simulator)

! Doctor found issues in 3 categories.

非常感谢您的帮助。

3 个答案:

答案 0 :(得分:2)

这可能是一些你可能会发现有用的东西:

1.尝试重新启动计算机

2。)一些参考文献:

https://github.com/flutter/flutter-intellij

https://plugins.jetbrains.com/plugin/9212-flutter

https://flutter.io/using-ide/

3.)检查你的日志输出flutter doctor -v

4.确保一切都是最新的

5.使用flutter channel命令检查颤动通道 也许尝试颤振频道大师

6。)尝试flutter upgrade

7。)甚至可以尝试安装其他所有其他扑克医生说缺失的东西。

我目前正在尝试使用Android设备而不是iOS来学习Flutter

答案 1 :(得分:1)

从颤动母线切换到颤动稳定,但未成功。然后切换回主频道,它开始工作。

答案 2 :(得分:0)

当登录的用户没有root权限时,会发生此问题。 这是在OSX更新后开始的。

关注此Flutter问题https://github.com/flutter/flutter/issues/18409