Home:ALL Converter>Flutter app crashes for iOS build on startup

Flutter app crashes for iOS build on startup

Ask Time:2022-03-04T20:22:59         Author:Sagar Acharya

Json Formatter

I am working on the application, where it was working in a proper manner. but later I did update the mac to macOS Monterey 12.2.1 and updated my iPhone device to latest 15.2 and Xcode 13.0 and used the latest one 13.2.1. But now the application runs crashes on startup or even after login with but there is which is driving me crazy.

Point is it does not work when building on xcode and it works fine when running from Android studio. So below are my specs that I am working on:

[✓] Flutter (Channel stable, 2.8.1, on macOS 12.2.1 21D62 darwin-x64, locale en-GB)
    • Flutter version 2.8.1 at /Users/username/development/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 77d935af4d (3 months ago), 2021-12-16 08:37:33 -0800
    • Engine revision 890a5fca2e
    • Dart version 2.15.1

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Users/username/Library/Android/sdk
    • Platform android-31, build-tools 30.0.3
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7590822)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 13.0)
    • Xcode at /Users/username/Desktop/Xcode.app/Contents/Developer
    • CocoaPods version 1.11.2

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

[✓] Android Studio (version 2021.1)
    • 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.11+0-b60-7590822)

[✓] VS Code (version 1.63.2)
    • VS Code at /Users/neosoft/Downloads/Visual Studio Code.app/Contents
    • Flutter extension version 3.34.0

[✓] Connected device (1 available)
    • Chrome (web) • chrome • web-javascript • Google Chrome 99.0.4844.51


Image for error on xcode

I have been using the Firebase Firestore as a data store. What can I try next?

Author:Sagar Acharya,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/71351351/flutter-app-crashes-for-ios-build-on-startup
Shawn :

For the most cases, the final solution for me was always deleting the whole ios folder (make sure to backup the logo, assets, ...), running flutter create -i swift . to recreate the ios folder, and running flutter clean.\nEvery time I face the error, I did those steps several times in a random order, and it just got solved.",
2022-04-04T00:26:40
Sharon Atim :

Inside iOS > AppDelegate.swift, add the FirebaseApp.configure() method before GeneratedPluginRegistrant.register(with: self)\n FirebaseApp.configure()\n GeneratedPluginRegistrant.register(with: self)\n\nAlternatively:\n\nRun flutter clean\nNavigate to the ios folder then delete the pods folder.\nFrom your terminal command cd ios , then run $pod install\nOnce complete, right-click ios > Open in Xcode.\nFrom the application window top menu bar, click Product > Clean Build Folder\nBuild the project (Product > Build)\nFrom your project terminal command flutter run\n",
2022-03-11T20:41:57
Kaushik Chandru :

Please take a backup of the project, delete pubSpec.lock, and from inside the ios folder delete 'Podfile.lock', pods directory and Xcworkspace. Then run flutter pub get then navigate to ios folder and run pod install. Then try building it in xcode.",
2022-03-07T21:23:24
NøBi Mac :

It seems like while building it takes reference from derive data for ios.\nFollow bellow steps hopefully, this will work\n\nDelete Derive data for ios\nDelete podfile.lock\nExecute flutter clean to your project terminal\nExecute flutter pub get\nMove to ios directory and execute pod install\n\nThen try to build from Xcode.",
2022-03-08T13:35:47
Maziar Saadatfar :

this error is for pod installation, when you run the flutter project, it installs all features as pod packages in the iOs app, you must be accurate to install pod from flutter correctly, so you must clear All pods cache and delete pods folder and all things depends on pod after that you must upgrade your cocoa and install or run your flutter app.\nmaybe with this config in podfile solves your issue:\npost_install do |installer|\n installer.pods_project.targets.each do |target|\n flutter_additional_ios_build_settings(target)\n target.build_configurations.each do |config|\n config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'\n end\n end\nend\n\n",
2022-03-13T00:24:09
yy