Home > Software design >  (solved) flutter run on iPhone simulator stucks on 'Xcode build done'. (it runs well in an
(solved) flutter run on iPhone simulator stucks on 'Xcode build done'. (it runs well in an

Time:11-11

Question

Hello, I'm having difficulty while running my Flutter App on iPhone simulator. It stucks on 'Xcode build done'. BTW, It runs very well on Android emulator.

It's my first time to ask a question here, so please let me know if more information is needed, or something seems inappropriate. Any kind of help (or comment) would be appreciated. Thank you.

The video of trying to launch the app manually: enter image description here

CodePudding user response:

Please check the errors in list_screen, line number 548 and 690. Delete Podfile.lock. Run flutter clean. Then run flutter run. navigate to ios folder in terminal with cd ios from the root of your project. Run pod install. Now once the pods are installed open the xcworkspace file in xcode and you might see a warning asking you to upgrade minimum version of ios. Allow it to upgrade settings. Now select the simulator from xcode and hit play. Once it plays well from xcode you should be able to run it directly from Android studio also.

CodePudding user response:

You need to initialize the firebase config into appdelegate.swift file.

import UIKit
import Flutter
import Firebase

@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
  override func application(
    _ application: UIApplication,
    didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
  ) -> Bool {
    GeneratedPluginRegistrant.register(with: self)
    
    if FirebaseApp.app() == nil {
        FirebaseApp.configure()
    }
    
   // FirebaseApp.configure()
    
   return super.application(application, didFinishLaunchingWithOptions: launchOptions)
  }
}

CodePudding user response:

Please try this for iOS app inside buildSettings in Xcode add new user defined

the key EXTRA_FRONT_END_OPTIONS with value --no-sound-null-safety

and clear Derived data and rebuild it again and then run it.

  • Related