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

3
创建了一个测试应用程序 flutter create hello_world。 在 iOS 模拟器上运行 flutter run 完美地启动了应用程序 - 它可以正常工作!但是,在真实的 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并重试。


1
卸载并重新运行您的应用程序。 - Constantin N.
当你说“卸载并重新运行应用程序”时,你的意思是什么?我创建了一个新的(像hello world一样的)应用程序,启动现成的应用程序,结果是相同的。 - iOS Dev
尝试这个:https://dev59.com/qFEG5IYBdhLWcg3wgPt3 - Constantin N.
在Flutter项目目录中运行flutter build ios解决了我的问题。 - Elad Nava
1个回答

1

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


尝试过了。不起作用。 - Prasanna Venkatesh

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接