创建了一个测试应用程序 flutter create hello_world
。
ios 模拟器上的 flutter run
完美启动应用程序 - 它有效!
但是当在真正的 iOS 设备上启动时,会出现窗口“本地网络”-> 按“允许”,然后只有白屏。
iOS 14.7.1
Xcode 12.5.1
签名和功能 - 没有错误
flutter doctor -v
颤动医生 -v [✓] Flutter (Channel stable, 2.2.3, on macOS 11.5 20G71 darwin-x64, locale RU-RU) • Flutter 2.2.3 版位于 /Users/incognito/Developer/flutter • 框架修订 f4abaa0735(4 周前),2021-07-01 12:46:11 -0700 • 引擎修订版 241c87ad80 • Dart 版本 2.13.4
[✓] Android 工具链 - 为 Android 设备开发(Android SDK 版本 31.0.0) • Android SDK 位于 /Users/incognito/Library/Android/sdk • 平台 android-31,构建工具 31.0.0 • Java 二进制文件位于:/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java • Java 版 OpenJDK 运行时环境(构建 11.0.8+10-b944.6916264) • 接受所有 Android 许可。
[✓] Xcode - 为 iOS 和 macOS 开发 • Xcode 位于 /Applications/Xcode.app/Contents/Developer • Xcode 12.5.1,构建版本 12E507 • CocoaPods 1.10.1 版
[✓] Chrome - 为网络开发 • Chrome 位于 /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio(4.2 版) • Android Studio 位于 /Applications/Android Studio.app/Contents • Flutter 插件可以从以下位置安装: ? https://plugins.jetbrains.com/plugin/9212-flutter • Dart 插件可以从以下位置安装: ? https://plugins.jetbrains.com/plugin/6351-dart • Java 版 OpenJDK 运行时环境(构建 11.0.8+10-b944.6916264)
[✓] 已连接设备(2 个可用) • iPhone 12 mini(手机) • 1CE9DEC7-D645-4C14-A3A5-79C4B1C8AB9F • ios • com.apple.CoreSimulator.SimRuntime.iOS-14-5(模拟器) • 铬(网页) • 铬 • web-javascript • 谷歌浏览器 92.0.4515.107 !错误:iPhone No Name 正忙:等待设备。 Xcode 将继续 当 iPhone No Name 完成时。 (代码-10)
Xcode 控制台
2021-07-30 01:27:14.959824+0300 Runner[440:12621] Metal API Validation Enabled
2021-07-30 01:27:15.028878+0300 Runner[440:12621] fopen failed for data file: errno = 2 (No such file or directory)
2021-07-30 01:27:15.028922+0300 Runner[440:12621] Errors found! Invalidating cache...
2021-07-30 01:27:15.076411+0300 Runner[440:12621] Warning: Unable to create restoration in progress marker file
2021-07-30 01:27:15.088662+0300 Runner[440:12868] [VERBOSE-2:shell.cc(93)] Dart Error: Can't load Kernel binary: Invalid kernel binary format version.
2021-07-30 01:27:15.088704+0300 Runner[440:12868] [VERBOSE-2:dart_isolate.cc(170)] Could not prepare isolate.
2021-07-30 01:27:15.088835+0300 Runner[440:12868] [VERBOSE-2:runtime_controller.cc(382)] Could not create root isolate.
2021-07-30 01:27:15.088861+0300 Runner[440:12868] [VERBOSE-2:shell.cc(576)] Could not launch engine with configuration.
2021-07-30 01:27:15.115109+0300 Runner[440:12882] flutter: Observatory listening on http://127.0.0.1:50825/Ibq99VrylBU=/
更新
后代的足迹: 解决办法——删除你的Flutter安装目录下的bin/cache目录,然后运行flutter doctor再试一次。
答案 0 :(得分:0)
后继者的足迹:解决方案 - 删除 Flutter 安装目录中的 bin/cache 目录,然后运行 flutter doctor 并重试。