Skip to main content

What causes (and how can I fix) this odd Core Location error?





ERROR,Generic,Time,320195751.128,Function,"void CLClientHandleRegistrationTimerExpiry(__CFRunLoopTimer*, void*)",Registration timer expired, but client is still registering!







There are only a few mentions of this problem that I was able to dig up in the wider Internet, and nobody has useful info. Here's the context:





I have an app that monitors the device's location via CLLocationManager's startUpdatingLocation method. It starts monitoring, runs for a little while, then this message pops up in the debug output. From that point forward, no more location updates are delivered.





This error is killing the location functionality of the app, and I'm at a loss as to what may be causing it. It even has an exclamation point at the end, which means it's clearly an exciting error.





Update:


Though I never found a solution to the problem, or figured out why it happens in the first place, I've also lost the ability to reproduce it. This seems to have happened during some period of time in which I did many things, including a general change in code structure followed by update to the iOS 5 beta. Something there seems to have silenced the issue for me.


Comments

  1. Have you implemented

    - (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error


    and does this catch it?

    You need to check for kCLErrorNetwork, kCLErrorDenied, kCLErrorHeadingFailure and kCLErrorLocationUnknown in the normal run of things but I'm wondering if there are other errors that the delegate can still catch?

    This could give you the opportunity to stop and then restart location services.

    ReplyDelete
  2. Going off of what @schillace had to share, is it possible that you're attempting to force location updates without heeding the user's authorization status?

    Try to hold off on calling -startUpdatingLocation until you know that [CLLocationManager authorizationStatus] == kCLAuthorizationStatusAuthorized.

    ReplyDelete
  3. I don't know if this is the answer or not, but here's a hint...I'm working with assetFromURL and I'm getting intermittent failures to load images from the asset library. So I wrote a bit of code to test a theory, that loads every url in the library very quickly. I started seeing this error with this bit of code.

    So...my theory is that if you make a call that causes the location manager to show the "app wants your location" dialog, and then you continue to make calls while that dialog is up, you'll get this error. Once I acknowledged the dialog and re-ran the program, I didn't see this error any more.

    Hope that helps, it's just a guess.

    ReplyDelete
  4. Are you sure this is a problem? It looks to me like you are debugging to a breakpoint (effectively suspending the application) before the registration to the location manager is completed. Meanwhile, the timer expires and you haven't finished your registration. If you take out the breakpoints, does the message ever appear?

    ReplyDelete
  5. Are you doing location stuff on the main thread? I had all sorts of bizarro issues with CLLocation API calls from a background thread. I moved a couple of key setup calls into the main thread, then everything worked fine.

    ReplyDelete
  6. I got the same error and figured out that it was because I had forgotten to mention that the class implements the CLLocationManagerDelegate in the .h file.

    Adding the CLLocationManagerDelegate to the header file, and the following line to point to the delegate solved the error for me.

    locationManager.delegate = self;
    [locationManager startUpdatingHeading];

    ReplyDelete
  7. I got this when implementing the timeout (perform selector after delay) in LocateMe, my previous code used another method. I don't know if this is a clue.

    ReplyDelete

Post a Comment

Popular posts from this blog

[韓日関係] 首相含む大幅な内閣改造の可能性…早ければ来月10日ごろ=韓国

div not scrolling properly with slimScroll plugin

I am using the slimScroll plugin for jQuery by Piotr Rochala Which is a great plugin for nice scrollbars on most browsers but I am stuck because I am using it for a chat box and whenever the user appends new text to the boxit does scroll using the .scrollTop() method however the plugin's scrollbar doesnt scroll with it and when the user wants to look though the chat history it will start scrolling from near the top. I have made a quick demo of my situation http://jsfiddle.net/DY9CT/2/ Does anyone know how to solve this problem?

Why does this javascript based printing cause Safari to refresh the page?

The page I am working on has a javascript function executed to print parts of the page. For some reason, printing in Safari, causes the window to somehow update. I say somehow, because it does not really refresh as in reload the page, but rather it starts the "rendering" of the page from start, i.e. scroll to top, flash animations start from 0, and so forth. The effect is reproduced by this fiddle: http://jsfiddle.net/fYmnB/ Clicking the print button and finishing or cancelling a print in Safari causes the screen to "go white" for a sec, which in my real website manifests itself as something "like" a reload. While running print button with, let's say, Firefox, just opens and closes the print dialogue without affecting the fiddle page in any way. Is there something with my way of calling the browsers print method that causes this, or how can it be explained - and preferably, avoided? P.S.: On my real site the same occurs with Chrome. In the ex