ios - Flutter 应用程序无法在真实的 iOS 设备上运行(白屏)

标签 ios flutter

创建了一个测试应用flutter create hello_worldflutter run 在 ios 模拟器上启动应用程序完美 - 它有效! 但是当在真实的 iOS 设备上启动时,会出现窗口“本地网络”-> 按“允许”,然后只有白屏。

iOS 14.7.1

Xcode 12.5.1

签名和功能 - 没有错误

flutter doctor -v

[✓] Flutter (Channel stable, 2.2.3, on macOS 11.5 20G71 darwin-x64, locale
    ru-RU)
    • Flutter version 2.2.3 at /Users/incognito/Developer/flutter
    • Framework revision f4abaa0735 (4 weeks ago), 2021-07-01 12:46:11 -0700
    • Engine revision 241c87ad80
    • Dart version 2.13.4

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /Users/incognito/Library/Android/sdk
    • Platform android-31, build-tools 31.0.0
    • Java binary at: /Applications/Android
      Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.5.1, Build version 12E507
    • CocoaPods version 1.10.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264)

[✓] Connected device (2 available)
    • iPhone 12 mini (mobile) • 1CE9DEC7-D645-4C14-A3A5-79C4B1C8AB9F • ios
      • com.apple.CoreSimulator.SimRuntime.iOS-14-5 (simulator)
    • Chrome (web)            • chrome                               •
      web-javascript • Google Chrome 92.0.4515.107
    ! Error: iPhone No Name is busy: Waiting for Device. Xcode will continue
      when iPhone No Name is finished. (code -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再试。

最佳答案

footprint for posterit:解决方案-删除Flutter安装目录下的bin/cache目录,然后运行flutter doctor再试。

关于ios - Flutter 应用程序无法在真实的 iOS 设备上运行(白屏),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68583475/

相关文章:

enums - 如何使用 Dart/Flutter 将枚举属性序列化/反序列化到 Firestore?

firebase - 如何清除 Flutter Firebase 中以前的用户缓存数据?

flutter - Flutter FCM token 作为全局变量

iOS Facebook 网络共享 api - 如何判断用户是否点击了跳过

ios - 如何在 iOS7 中对 UIView 进行半透明处理

ios - UIControl 阻止了我在 iPhone 上的所有 View

android - 亚行 : failed to install

ios - UITableView 可重用自定义单元格在 subview 中显示错误内容

ios - 为模拟器构建时出现架构 i386 错误的 undefined symbol

flutter - 使用Flutter计算两个日期之间的天数