我成功地在模拟器上运行了我的应用程序( iPhone 12,iOS 14.5),但是当它在真正的iPhone 11 Pro Max(iOS 14.7.1)上运行时,我面对的只是一个黑色的屏幕。以下是Xcode的输出:
2021-09-16 18:48:00.155232+0300 Runner[2396:1009680] Metal API Validation Enabled
2021-09-16 18:48:00.244991+0300 Runner[2396:1009680] Could not load the "LaunchImage" image referenced from a nib in the bundle with identifier "xxx.yyy.zzz"
2021-09-16 18:48:00.353909+0300 Runner[2396:1009946] [VERBOSE-2:shell.cc(93)] Dart Error: Can't load Kernel binary: Invalid kernel binary format version.
2021-09-16 18:48:00.354015+0300 Runner[2396:1009946] [VERBOSE-2:dart_isolate.cc(170)] Could not prepare isolate.
2021-09-16 18:48:00.354185+0300 Runner[2396:1009946] [VERBOSE-2:runtime_controller.cc(382)] Could not create root isolate.
2021-09-16 18:48:00.354213+0300 Runner[2396:1009946] [VERBOSE-2:shell.cc(576)] Could not launch engine with configuration.
2021-09-16 18:48:00.367242+0300 Runner[2396:1009960] flutter: Observatory listening on http://127.0.0.1:54273/PrvtvZOQ8Wc=/颤栗医生:
[✓] Flutter (Channel stable, 2.2.3, on macOS 11.5.2 20G95 darwin-x64, locale
ru-BY)
[✗] Android toolchain - develop for Android devices
✗ Unable to locate Android SDK.
Install Android Studio from:
https://developer.android.com/studio/index.html
On first launch it will assist you in installing the Android SDK
components.
(or visit https://flutter.dev/docs/get-started/install/macos#android-setup
for detailed instructions).
If the Android SDK has been installed to a custom location, please use
flutter config --android-sdk to update to that location.
[✓] Xcode - develop for iOS and macOS
[✗] Chrome - develop for the web (Cannot find Chrome executable at
/Applications/Google Chrome.app/Contents/MacOS/Google Chrome)
! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[!] Android Studio (not installed)
[✓] Connected device (2 available)Xcode 12.5.1
已更新
若要解决此问题,请删除运行rm -rf ~/flutter/bin/cache。然后运行flutter run (您应该从终端运行应用程序,而不是从IDE运行,以便下载丢失的文件)。现在不知怎么起作用了。
发布于 2022-09-12 17:11:22
使用rm -rf ~/flutter/bin/cache删除缓存对我有效。这个问题似乎是由一个糟糕的颤振安装引起的。删除缓存后运行flutter pub get应再次下载包并重新构建项目。
https://stackoverflow.com/questions/69212382
复制相似问题