Not able to run flutter app on iOS Simulator

Viewed 13209

I am not able to run my flutter app on iOS Simulator. It is giving me this error :

Launching lib/main.dart on iPhone XR in debug mode... Starting Xcode build... Xcode build done. 7.9s Failed to build iOS app Error output from Xcode build: ↳ ** BUILD FAILED **

Xcode's output: ↳ === BUILD TARGET url_launcher OF PROJECT Pods WITH CONFIGURATION Debug === /Users/snehal/.pub-cache/hosted/pub.dartlang.org/simple_permissions-0.1.9/ios/Classes/SwiftSimplePermissionsPlugin.swift:51:38: error: 'UIApplicationOpenSettingsURLString' has been renamed to 'UIApplication.openSettingsURLString' if let url = URL(string: UIApplicationOpenSettingsURLString) { ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ UIApplication.openSettingsURLString UIKit.UIApplicationOpenSettingsURLString:3:12: note: 'UIApplicationOpenSettingsURLString' was obsoleted in Swift 4.2 public let UIApplicationOpenSettingsURLString: String ^

Could not build the application for the simulator. Error launching application on iPhone XR.

Please Help. Thanks in advance :)

I want to run my app on iOS Simulator.

5 Answers

if you have no luck then try to open with Xcode (Build and Run Enjoy):

enter image description here

  1. Open the project as @Nazmul Hasan has indicated with xcode.
  2. Build the project.
  3. Run the project.
  4. Error will be shown as follows
  5. click fix

Open POD file in ios folder. Search 'SWIFT_VERSION' and change it to 4.2 ...like this

config.build_settings['SWIFT_VERSION'] = '4.2'

then do flutter run

Did you check flutter channel ?

Firstly, you should check after run flutter channel command in terminal.

then , you should change flutter channel as master with flutter channel master command.

Finally, restart IOS Simulator and run flutter in your application.

I hope that will be useful.

hello my case is add dependencie wrong path haha. not about upgrade anything

please check dependencie if you try fix same on top comment then can't fix your problem.

in my case wrong path of asset , image , font of my project.

Related