Why my Flutter app not running on iPhone?

Viewed 1925

I successfully run my app on simulator(iPhone 12, iOS 14.5), but when it running on real iPhone 11 Pro Max(iOS 14.7.1) I facing just a black screen. Here is the output from 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 doctor:

[✓] 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


UPDATED

To fix this, remove run rm -rf ~/flutter/bin/cache. Then run flutter run (you should run your app from terminal instead of IDE in order to Flutter download missing files). It's somehow works now.

1 Answers

Deleting the cache using rm -rf ~/flutter/bin/cache worked for me. This issue seems to have been caused by a bad Flutter installation. Running flutter pub get after deleting the cache should download the packages again and rebuild the project.

Related