dpa99c / phonegap-launch-navigator

Phonegap/Cordova plugin which launches native route navigation apps for Android, iOS and Windows
369 stars 131 forks source link

iOS build failure - platform - 4.4.0 #148

Closed vpilot closed 7 years ago

vpilot commented 7 years ago

Local cordova build for iOS platform fails with the following 2 errors:

LaunchNavigator.m:313:55: error: no visible @interface for 'MKPlacemark' declares the selector 'initWithCoordinate:' MKPlacemark* placemark = [[MKPlacemark alloc] initWithCoordinate:destCoord]; and LaunchNavigator.m:324:87: error: no visible @interface for 'MKPlacemark' declares the selector 'initWithCoordinate:' start_mapItem = [[MKMapItem alloc] initWithPlacemark:[[MKPlacemark alloc] initWithCoordinate:star...

Operation system: OS X Yosemite 10.10.5 Xcode: 7.2.1 Cordova: 7.0.1 iOS platform: 4.4.0 Plugin: 4.0.4

I have tried to clean the project and re-added plugin but nothing has worked so far. A build is successful and I can run the app if the plugin is removed. Looking at the source code it appeared that errors are happening when [MKPlacemark alloc] initWithCoordinate: is triggered.

Lines affected in LaunchNavigator.m: MKPlacemark* placemark = [[MKPlacemark alloc] initWithCoordinate:destCoord]; and start_mapItem = [[MKMapItem alloc] initWithPlacemark:[[MKPlacemark alloc] initWithCoordinate:startCoord]];

dpa99c commented 7 years ago

The problem is you are building with Xcode 7, which is outdated. This version of Xcode builds with the iOS 9 SDK, but initWithCoordinate was added in the iOS 10 SDK for which you'll need to build with Xcode 8. Given than Xcode 9/iOS 11 will be in final release in the next month or two, I see no reason to make the plugin backwardly compatible with Xcode 7.

vpilot commented 7 years ago

Oh, I see. Thanks for the clarification Dave. Status - updating Xcode...