Select to view content in your preferred language

Strange ArcGIS.runtime error {NSLocalizedFailureReason=location data source is not started yet., NSLocalizedDescription=Invalid argument., [...]

618
2
Jump to solution
03-24-2022 10:27 AM
AndrewMcLane
Emerging Contributor

Hi Community!

 

Been working on an AR app and all of the sudden, features stopped working I get this message (repeatedly)

ArcGIS Runtime Error Occurred. Set a breakpoint on C++ exceptions to see the original callstack and context for this error:  Error Domain=com.esri.arcgis.runtime.error Code=2 "Invalid argument." UserInfo={NSLocalizedFailureReason=location data source is not started yet., NSLocalizedDescription=Invalid argument., Additional Message=location data source is not started yet.}

along with this message

 [tcp] tcp_input [C5.1:3] flags=[R.] seq=1349585430, ack=4156404933, win=501 state=CLOSED rcv_nxt=1349585406, snd_una=4156404932

 

I have looked at the custom CLLocation CLLocationManager and CLLocationManagerDelegate just in case this had something to do with it, but I can't see a connection.

I have checked my plist for location privileges and they're okay. 

When a scene is switched, ArcGisARView(arView) stops tracking, a new AGSScene is instantiated, elevation source added, then I set the location data source with ```arView.locationDataSource = AGSCLLocationDataSource()```, then set the translation factor to 1. Then I reset tracking, and then start it.

 

Thanks so much for all the help!

0 Kudos
1 Solution

Accepted Solutions
MarkDostal
Esri Regular Contributor

Hello!  I think your analysis is correct when you mention the locationTrackingMode == .initial as the culprit.  In this line in ArcGISARView.swift you can see that the location data source is stopped if the tracking mode is anything other than .continuous. If you are depending on the location data source continuously providing location updates, use the ARLocationTrackingMode.continuous mode.

Let us know if that doesn't solve your problem or you have other questions.  Best of luck!

Mark

View solution in original post

2 Replies
AndrewMcLane
Emerging Contributor

More on this:

I stepped through the ArcGISARView.startTracking(locationTrackingMode:, completion:). error is == nil throughout the process. The function returns just fine, but for some reason, arView.isTracking remains false. The tracking mode is set to .initial. Would that explain why arView.Tracking is equal to false? 

I'm checking out ArcGISARView.finalizeStart() to see if self is nil and there is an early return, thus early escaping and skipping the statements below that should be called.

0 Kudos
MarkDostal
Esri Regular Contributor

Hello!  I think your analysis is correct when you mention the locationTrackingMode == .initial as the culprit.  In this line in ArcGISARView.swift you can see that the location data source is stopped if the tracking mode is anything other than .continuous. If you are depending on the location data source continuously providing location updates, use the ARLocationTrackingMode.continuous mode.

Let us know if that doesn't solve your problem or you have other questions.  Best of luck!

Mark