Location Manager Error : Operation could not be completed(KCLErrorDomain error 0)
why this error occurs?
Location Manager Error : Operation could not be completed(KCLErrorDomain error 0)
why this error occurs?
From the API docs:
CLError
Error codes returned by the location manager object.
typedef enum { kCLErrorLocationUnknown = 0, kCLErrorDenied, kCLErrorNetwork, kCLErrorHeadingFailure } CLError;
Constants
kCLErrorLocationUnknown The location manager was unable to obtain a location value right now.Available in iPhone OS 2.0 and later. Declared in CLError.h.
kCLErrorDenied Access to the location service was denied by the user. Available in iPhone OS 2.0 and later. Declared in CLError.h.
kCLErrorNetwork The network was unavailable or a network error occurred. Available in iPhone OS 3.0b and later. Declared in CLError.h.
kCLErrorHeadingFailure The heading could not be determined. Available in iPhone OS 3.0 and later. Declared in CLError.h.
So this means the location could not be determined.
I would guess the most likely cause is that the location manager is using WiFi to triangulate the location, and the database doesn't cover the local networks. That apparently can be fixed by the user if they go here.
However as I noted I have also seen this occasionally as a transient error when running a location based program in a location where the WiFi location stuff normally works.
Lastly I guess it is possible to see this error if there is some kind of hardware failure.
I just had this problem. Took me a while to find the solution, which is only loosely related to the previous poster's answer.
Airport (WiFi) must be on for CoreLocation in the iPhone/iPad Simulator to work. I was connected via Ethernet so CL didn't do anything in the Simulator. Turn on Airport in your Network Settings and try again. You can change the order of your network interfaces by dragging Airport below Ethernet if you want to continue favoring your wired connection over your wireless...