Geolocation plugin breaks Ionic


#1

Not sure if this is an Ionic bug or somehting at the Cordova level. I’m using Geolocation in my app and I had NOT added the plugin. This works fine in testing, and is supported on mobile browsers of course, but when you don’t add the plugin, your app gets 2 different warnings when getting the position (http://www.raymondcamden.com/2013/11/2/Seeing-two-geolocation-prompts-in-a-PhoneGapCordova-application).

So - I added the plugin, and as soon as I did, Ionic stopped being able to emulate or build. When I do a build, I get this:

The following build commands failed:
CompileC build/v6.build/Debug-iphonesimulator/v6.build/Objects-normal/i386/CDVLocation.o v6/Plugins/org.apache.cordova.geolocation/CDVLocation.m normal i386 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
Error: /Users/ray/Dropbox/websites/testingzone/angular/ineedit/v7/platforms/ios/cordova/build: Command failed with exit code 65
at ChildProcess.whenDone (/Users/ray/npm/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:135:23)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:753:16)
at Process.ChildProcess._handle.onexit (child_process.js:820:5)
Error from build command.


#2

Hey there,

hmm this seems like a corodva issue, something went wrong while trying to move the plugins over. I’ve seen two options that have solved the issue.

  1. Delete the platform projects. Kind of sucks, but can be easily added back.
  2. Delete the .json files in your plugin folder. When you build again, it will treat the plugins as a fresh install.

#3

That did seem to work. How concerned should I be about this? I did a similar test with just Cordova (new project, add ios, and geolocation, build) and wasn’t able to replicate.


#4

Normally I wouldn’t be too concerned. But it is an issue cordova needs to address since it can happen. The odd thing is I can really pin-point what causes the issue.