Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

Error in geolocation code

Helo I need help please
My code for geolocation work on iphone sdk 3.1.3 but does not work in 4.0
I get the following error: Error Domain=kCLErrorDomain Code=0 "The operation couldn?t be completed. (kCLErrorDomain error 0.)"

I'm using the code

Titanium.Geolocation.getCurrentPosition(function(e)
{
    if (e.error)
    {
        Titanium.API.info(e.error);
        return;
    }
    var longitude = e.coords.longitude;
    var latitude = e.coords.latitude;
});

Thanks!!

— asked June 25th 2010 by Pedro Camarelles
  • 4.0
  • error
  • geolocation
  • getcurrentposition
  • iphone
  • kclerrordomain
1 Comment
  • I'm having the same issue. Anyone know what's the cause of this error?

    — commented July 4th 2010 by Randy Hall

2 Answers

  • On Simulator:

    http://www.how2s.org/index.php/How_to_interpret_iPhone_Development_Error_Messages_and_what_to_do_to_resolve_them#Error_Domain.3DkCLErrorDomainCode.3D0.22The_operation_couldn.E2.80.99t_becompleted..28kCLErrorDomain_error_0..29.22

    But on device I found that LocationServices was on, but in testing I'd stopped the app being able to access the location and you have to go into Location Services (settings) to re-enable it.

    — answered July 20th 2010 by Leo Lapworth
    permalink
    0 Comments
  • Moreover, for my problem it needs about 1 minute before the message is shown.

    — answered August 17th 2010 by Sreyleap Lay
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.