What does Core Motion error 102 mean? - iphone

I use Core Motion's sensor fusing to get north oriented motion updates:
[motionManager startDeviceMotionUpdatesUsingReferenceFrame:CMAttitudeReferenceFrameXTrueNorthZVertical toQueue:motionQueue withHandler:motionHandler]
In a very rare case that can be reproduced only on selected customer devices (iPhone 4S running iOS 6.0.2) I receive this error in the motionHandler:
Error Domain=CMErrorDomain Code=102 "The operation couldn’t be completed. (CMErrorDomain error 102.)
Also, it seems I don't get any valid deviceMotion updates after that. Does anybody know what this error 102 means? I can't find anything in the documentation.

As Krishnabhadra correctly pointed out, this error code means CMErrorTrueNorthNotAvailable. The description ("True north is not available on this device. This usually indicates that the device’s location is not yet available.") unfortunately doesn't give any hint how to solve the issue so I'd like to describe my findings when this error occurs.
It occurs on a tiny (a handful out of many thousands) fraction of iOS 6.0+ devices when using CMAttitudeReferenceFrameXTrueNorthZVertical (CMAttitudeReferenceFrameXMagneticNorthZVertical is OK). Despite the error description, Core Location works correctly. On affected devices the bug is triggered in 100% of the cases and blocks Core Motion updates completely. -[CMMotionManager deviceMotion] always returns nil.
Resetting the iOS system settings fixes the problem.
I’ve logged rdar://12952327 with some more details.
Update:
This error occurs if compass calibration is disabled in the privacy / location services / system services section.

From documentation
typedef enum {
CMErrorNULL = 100,
CMErrorDeviceRequiresMovement,
CMErrorTrueNorthNotAvailable
} CMError;
It seems error 102 is CMErrorTrueNorthNotAvailable, and its description is
CMErrorTrueNorthNotAvailable
It seems not much information is available regarding what causes this error. It can be any hardware issue with the device.

Also, make sure this is enabled. After I enabled this option, I did not encounter the 102 issue anymore while using xTrueNorthZVertical.
Settings > Privacy > Location Services > System Services > Compass Calibration

102 is CMErrorTrueNorthNotAvailable. I guess that your device has problems with determining north direction or something.

I got this error and when i tried to find solution, apparently my location services in my device are switched off, once i switched on, it worked.

Related

Google play list this error Broadcast of Intent { act=android.accounts.LOGIN_ACCOUNTS_CHANGED

I got following error on google play store but I have no idea why this error occured. They said that it is happing on (Sharp AQUOS sense2 SH-01L Android 9 (SDK 28) ).
I have logcat but I can't find anything in logcat too. I already released to production. This one is my bugs fixed for new release.
ANR in com.google.android.apps.tachyon;PID: 18069;Broadcast of Intent {
act=android.accounts.LOGIN_ACCOUNTS_CHANGED flg=0x5000010 cmp=com.google.android.apps.tachyon/com.google.apps.tiktok.account.data.device.DeviceAccountsChangedReceiver_Receiver };
A similar Error occurred for me as well.
"ANR in com.google.android.apps.tachyon" at same device "Sharp AQUOS sense2 SH-01L"
E/ActivityManager(1566): ANR in com.google.android.apps.tachyon
E/ActivityManager(1566): PID: 18457
E/ActivityManager(1566): Reason: Broadcast of Intent { act=android.intent.action.LOCALE_CHANGED flg=0x11200010 cmp=com.google.android.apps.tachyon/.common.applifecycle.LocaleChangeReceiver }
I believe this device has com.google.android.apps.tachyon app is installed by default and an automatic update for this app could be running in the background (just a guess) which crashes anytime.
The crash is just a coincidence.
It will not happen every time with the same app and with the same use case. It will also not happen with any other device. just update the versionCode and publish the App again.
One other option is to go to the device catalog and mark this device as not supported.
After a lot of research, I think I have finally solved this for my app.
In my case, other than my main activity, the other Activies were only called by my app. In my activities in my AndroidManifest.xml, I had
android:exported="true"
Of course, this allows these activities to be invoked by other external activities/etc
By changing this to:
android:exported="false"
...it prevents the activity from being called.
In my case and going through the logs, I didn't see anything that jumped out and bit me but my research led me to believe that com.google.apps.tiktok.* was some sort of old transactional piece of Android. Also, I noticed my Tutorial activity was logging well after it should have been.
My suspicion is the test may actually be real and intended to check for either Activities handling external launches or checking for a security injection of some kind.
I think the use case is likely that an Android user is changed on the phone (usually at end of these robo tests), ticktok handles that and sends this intent/message to all externally known Activities. If so, that would mean either the Activities have to not be exported or handle the intent appropriately.
Anyhow, this change helped me tremendously and I haven't hit this with this app since after about 100 robo tests. Hope it helps someone else.
I think this is a problem with Google Play Store testing devices. Problems went away without me making any changes on a new release.

DJI Assistant 2 simulator will not run missions. DJI ERROR 5021 "TOTAL MISSION DISTANCE TOO LARGE"

So I have been writing an application to run custom missions, the missions run fine and everything works as intended, however when attempting to run on the simulator I receive this error.
The missions should not be considered too large as I calculate distance at 1081m and attempting to physically run this mission succeeds. Trying to do the same in the simulator is resulting in error code 5021.
If it is helpful I also get error code 1003 "This process has timed out"
Any help with this would be appreciated as I have spent much time trying to solve this issue.
I can provide further info if needed however nothing seems relevant at this time except that which I have said.
Are you using the waypoint function to let the drone move with pre-defined latitude and longitude? If the answer is yes! then possibly that because the constant latitude and longitude in the GUI of the simulator are far from your GPS points.
And this is not allowed from the SDK for safety reasons.
So, basically, it is not allowed to set waypoints far from the Home location (the location where the drone would take off from)
As Mohamad Ghaith Alzin mentioned, maybe the waypoints in your mission are too far away from the home located in the simulator. You can try to set the location in the simulator to the location of the first/start waypoint. You can do it before starting the simulator like below:
the simulator GUI

Unity Tango app crashing when using FindPlane function

Recently I've started porting my older Unity code with an earlier version of the Tango / Unity SDK to the latest version. Overall, it's working great. Faster frame rate, less drift, everything seems pretty good....Until: BLAM... Sudden crash. So, I tried paring down my app to the essentials to see if I could reproduce the crash and what I've found is that if I follow the AR Unity example in the docs to the letter, no problem. But, if I add a 'FindPlane' call within the Update() function so I place a sphere at the planeCenter of whatever is at 960,600 (middle of screen), after a few minutes the app will crash. So my suspicion is that this is what's causing the crash in my larger app (with many more moving parts, so to speak).
My question is two part:
1) can anyone suggest some debugging processes to help me identify exactly what the problem is here, in case it isn't the FindPlane function after all?
2) does anyone know why the FindPlane function might cause an error? Even if it doesn't successfully find a point it should still return Vector3.zero and a new/default Plane object, neither of which should result in a crash.
Thank you for your thoughts on this perplexing issue.
EDIT: I tried installing and activating Tango-Debug-Overlay recently and it shows a bit of diagnostic info. The problem appears to be thermal, and from what I can tell, related to the depth sensor. So now I'm trying to set a very low FPS, as a test, and disabling the depth sensor between frames, to see if that has any impact. I will post updates as I find out info.

What does this error mean: "lo->hi recycling invariant violated!" and what can I do to fix it?

My iPhone app started logging this error:
lo->hi recycling invariant violated!
followed by:
Program received signal: “EXC_BAD_ACCESS”
whenever I launched it on my iPod (3.1.3) and sometimes when I launch it in the simulator.
What does this error mean, and how can I fix it?
I am using cover-flow in my app. I think this might be the problem.
Thanks in advance.
Yes cover flow is the problem. Note that UICoverFlowLayer is private API. If you're targeting for AppStore, consider other alternatives here.
The error "lo->hi recycling invariant violated!" is raised by -[UICoverFlowLayer _updateTick], which should be caused by reusing the wrong sublayer for display. The detail I don't know because there's no detail code, nor I'm familiar with the Cover Flow API.

Location Manager Error : (KCLErrorDomain error 0)

Location Manager Error : Operation could not be completed(KCLErrorDomain error 0)
Why does this error occur?
This error occurs if you have Scheme/Edit Scheme/Options/Allow Location Simulation checked but don't have a default location set. I'm sure there are other causes as well though.
UPDATE
THANKS TO Ben Marten
You can make it permanent using these steps in XCode:
Product > Scheme > Edit Scheme
Click Run .app
Option tab
Already checked Core Location > select your location
Press OK
Besides that, even if you are not connected to wifi, you can set a location in simulator through top menu items Debug>Location and to make it permanent follow steps above
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...
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.
1) check that you actually have a valid WiFi and 3G connection
if you do then
2) go to settings and reset your location services
3) reset your network settings
If you got this in Emulator then do following
Debug > Location > ✓ Apple
This error is thrown when Location Manager is unable to get location information immediately. I found that this error was occurring when startUpdatingLocation method was called. For me, this was happening on iPod but not on iPhone. That makes sense, since, iPhone has more ways (like cellular network) to get location information and is able get a quick estimate on the location whereas iPod takes more time which caused this error to be raised on iPod.
Since, when this error is thrown locationManager:didFailWithError: delegate method is called, one can handle this specific case in a conditional statement by matching "[error domain]" and "[error code]" from the error object passed to this method.
The exact reason what I have found is there is a conflict occuring in the location simulation in both the ios simulator “Debug settings” and in the xcode settings “Edit schemes”.Ensure to set you default user location in any one of this and mark the other to None solved the problem hope this might help for sure.
InXcode:
In iphone/ipad simulator:
You can add your own list of locations to Xcode to test your applications with.
From within Xcode select the menu Debug/Simulate Location and you'll be offered:
a. "Don't Simulate Location"
b. 12 example locations
c. "Add GPX File to Project..."
Select "Add GPX File to Project..." and select the GPX file you've created.
Go to Xcode project >product>scheme>edit scheme>chek location simulation>set your location> and run app again Hope it will works !
Thanks to this article (https://possiblemobile.com/2013/04/using-xcode-to-test-location-services/) I got a hint to look at the data on my custom GPX file and there found the issue.
Some GPX files you might get from different sources might have the following elements indicating the different coordinates in specified path. This wont work with Xcode's Location Simulation.
<gpx>
...
<trkpt lat="" lon="">
<ele></ele>
</trkpt>
...
</gpx>
What you should do is find all occurrences of the "trkpt" element and replace it with "wpt" in your favorite text/xml editor. The end result should be something as follows:
<gpx>
<wpt lat="" lon="">
<ele></ele>
</wpt>
...
</gpx>
Hope this helps! It certainly helped me.
This error occur while you run your program ,but you simulate location after you run the programe.
I get a method :quit your simulator and restart it ,then set your simulator location before you run the programe,and it works for me .
Hope this helps! It certainly helped me.
thanks...
all of this didn't work for me.. what worked for me is :-
set the location from the simulator to none then change it back to custom location while the app is running.
All of the suggestions didn't help in my case. What helped was to uninstall the app from the simulator device, reinstall it and allow it to access the location (in the settings app).
If you are getting this on the device, chances are you did not ask for or the user denied the permission to gather the location.