4
votes

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.

6
Does running "flutter devices" shows your Simulator in list? Also, "flutter doctor" shows any issue? - Ganapat
@Ganpat yeah it's showing the flutter devices as android emulator and iOS simulator too. And there are no issues when I am running a flutter doctor. - Snehal Lokhande
@Feu tried this also but not working :( - Snehal Lokhande
what swift_version did you use and what Xcode version are you using? - Feu

6 Answers

3
votes

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

enter image description here

2
votes
  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
1
votes

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

1
votes

I was also having this problem. I ran flutter channel and saw I was in beta channel. I then ran flutter channel master to switch over. This fixed the problem for me.

0
votes

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.

0
votes

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.