Select to view content in your preferred language

Custom LocationDataSource error on Start

800
1
01-07-2018 02:25 PM
DanielKilimnik
Emerging Contributor

I want to create a custom LocationDataSource class. It works all fine but sometimes there is ArcGISRuntimeException thrown by the onStartCompleted method and sometimes everything works fine.

@Override
protected void onStart() {
    onStartCompleted(null);
}

The stack trace is:

(at de.fxreality.aRFragment.slidePanel.MyLocationDataSource.onStart(MyLocationDataSource.java:16) is linked to the onStartCompleted method)

E/AndroidRuntime: FATAL EXCEPTION: Thread-8848
Process: de.fxreality, PID: 11112
Theme: themes:{}
com.esri.arcgisruntime.ArcGISRuntimeException: Invalid argument
at com.esri.arcgisruntime.internal.jni.CoreLocationDataSource.nativeHandleStart(Native Method)
at com.esri.arcgisruntime.internal.jni.CoreLocationDataSource.a(SourceFile:125)
at com.esri.arcgisruntime.location.LocationDataSource.onStartCompleted(SourceFile:326)
at de.fxreality.aRFragment.slidePanel.MyLocationDataSource.onStart(MyLocationDataSource.java:16)
at com.esri.arcgisruntime.location.LocationDataSource$a$1.run(SourceFile:457)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)

Maybe someone can tell me what the problem is. I can't find any solution to it. I tried calling the method with an Exception object but then the LocationDataSource wouldn't start at all.

0 Kudos
1 Reply
ShellyGill1
Esri Contributor

Hi Daniel - can you add more information about the exception - the AddtionalMessage, ErrorCode, ErrorDomain, and also all the details from the Cause if that's set. Also post more information about your custom location data source class - what happens in your startup code? 

I tried calling the method with an Exception object but then the LocationDataSource wouldn't start at all.

You'd pass in an exception to the start completed if your own code caught an exception and then wanted to pass that back to the location listeners to indicate to consumers that the startup failed.

0 Kudos