Problems with the Phonegap/Cordova geolocation plugin on iOS 8

Are you having issues with your location aware Phonegap app on iOS 8? I did too. My first attempt to deploy an existing app through Xcode on an iOS 8 device did not work. The application would not recognize my iPhone location.

Here is the quick solution:

  1. In Xcode click on your app name in the sidebar
  2. Click the Build Phases tab
  3. Expand the Compile Sources section
  4. Click the + sign and add CDVLocation.m to the list of sources

That should do the trick. If not, try reinstalling the plugin:

  1. In Terminal navigate to the project folder
  2. cordova plugin rm org.apache.cordova.geolocation
  3. cordova plugin add org.apache.cordova.geolocation
  4. cordova build

If you still have issues after this you need to create a new cordova project, add all of the plugins, copy all resources (www folder, splash screens, and icons) and rebuild.