mattermoran / map_launcher

Flutter plugin for launching maps
MIT License
259 stars 116 forks source link

Getting Xcode build error when trying to run on IOS Simulator iPhone 11 Pro 14.0 #92

Closed smh53 closed 2 years ago

smh53 commented 2 years ago

It's running on Android perfectly but not working on IOS simulator. Hele is the build error:

Xcode's output: ↳ /Users/macbook/.pub-cache/hosted/pub.dartlang.org/maplauncher-2.1.1/ios/Classes/SwiftMapLauncherPlugin.swift:107:30: error: 'open(:options:completionHandler:)' is only available in iOS 10.0 or newer UIApplication.shared.open(URL(string:url)!, options: [:], completionHandler: nil) ^ /Users/macbook/.pub-cache/hosted/pub.dartlang.org/map_launcher-2.1.1/ios/Classes/SwiftMapLauncherPlugin.swift:107:30: note: add 'if #available' version check UIApplication.shared.open(URL(string:url)!, options: [:], completionHandler: nil) ^ /Users/macbook/.pub-cache/hosted/pub.dartlang.org/map_launcher-2.1.1/ios/Classes/SwiftMapLauncherPlugin.swift:94:14: note: add @available attribute to enclosing global function private func showMarker(mapType: MapType, url: String, title: String, latitude: String, longitude: String) { ^ /Users/macbook/.pub-cache/hosted/pub.dartlang.org/maplauncher-2.1.1/ios/Classes/SwiftMapLauncherPlugin.swift:135:30: error: 'open(:options:completionHandler:)' is only available in iOS 10.0 or newer UIApplication.shared.open(URL(string:url)!, options: [:], completionHandler: nil) ^ /Users/macbook/.pub-cache/hosted/pub.dartlang.org/map_launcher-2.1.1/ios/Classes/SwiftMapLauncherPlugin.swift:135:30: note: add 'if #available' version check UIApplication.shared.open(URL(string:url)!, options: [:], completionHandler: nil) ^ /Users/macbook/.pub-cache/hosted/pub.dartlang.org/map_launcher-2.1.1/ios/Classes/SwiftMapLauncherPlugin.swift:112:14: note: add @available attribute to enclosing global function private func showDirections(mapType: MapType, url: String, destinationTitle: String?, destinationLatitude: String, destinationLongitude: String, originTitle: String?, originLatitude: String?, originLongitude: String?, directionsMode: String?) { ^ /Users/macbook/.pub-cache/hosted/pub.dartlang.org/maplauncher-2.1.1/ios/Classes/SwiftMapLauncherPlugin.swift:107:30: error: 'open(:options:completionHandler:)' is only available in iOS 10.0 or newer UIApplication.shared.open(URL(string:url)!, options: [:], completionHandler: nil) ^ /Users/macbook/.pub-cache/hosted/pub.dartlang.org/map_launcher-2.1.1/ios/Classes/SwiftMapLauncherPlugin.swift:107:30: note: add 'if #available' version check UIApplication.shared.open(URL(string:url)!, options: [:], completionHandler: nil) ^ /Users/macbook/.pub-cache/hosted/pub.dartlang.org/map_launcher-2.1.1/ios/Classes/SwiftMapLauncherPlugin.swift:94:14: note: add @available attribute to enclosing global function private func showMarker(mapType: MapType, url: String, title: String, latitude: String, longitude: String) { ^ /Users/macbook/.pub-cache/hosted/pub.dartlang.org/maplauncher-2.1.1/ios/Classes/SwiftMapLauncherPlugin.swift:135:30: error: 'open(:options:completionHandler:)' is only available in iOS 10.0 or newer UIApplication.shared.open(URL(string:url)!, options: [:], completionHandler: nil) ^ /Users/macbook/.pub-cache/hosted/pub.dartlang.org/map_launcher-2.1.1/ios/Classes/SwiftMapLauncherPlugin.swift:135:30: note: add 'if #available' version check UIApplication.shared.open(URL(string:url)!, options: [:], completionHandler: nil) ^ /Users/macbook/.pub-cache/hosted/pub.dartlang.org/map_launcher-2.1.1/ios/Classes/SwiftMapLauncherPlugin.swift:112:14: note: add @available attribute to enclosing global function private func showDirections(mapType: MapType, url: String, destinationTitle: String?, destinationLatitude: String, destinationLongitude: String, originTitle: String?, originLatitude: String?, originLongitude: String?, directionsMode: String?) {

mattermoran commented 2 years ago

The minimum version of iOS supported is 10 as it's mentioned in the error message. You need to update your project's ios version

MohamedMoaayed commented 2 years ago

I fixed this by changing the ios version on ios/podfile

karbyshevdev commented 2 years ago

The same problem. I set the ios version in ios/podfile and in the project to 12, but not works.

agordeev commented 2 years ago

Don't forget to do flutter clean and pod install

mattermoran commented 2 years ago

As mentioned above bumping the ios version in podile/xcode and running flutter clean should resolve this issue. Closing.