App crash
Closed this issue · 5 comments
Hi,
I noticed that uLogger has a setting for a minimal distance between points to send an update of position. By lowering the default value (typically to "no minimum"), uLogger suddenly crashes with an Android popup about uLogger crashing and asking whether to open it again or not.
I might be able to pull a logcat
log if it can help investigating the issue.
Thanks!
Actually, it seems it is coming from the upload part and has nothing to do with the minimum distance. Not sure why this is happening now though while it was working fine in the past.
Traceback is
01-01 22:18:31.657 21551 21589 E AndroidRuntime: FATAL EXCEPTION: IntentService[WebSyncService]
01-01 22:18:31.657 21551 21589 E AndroidRuntime: Process: net.fabiszewski.ulogger, PID: 21551
01-01 22:18:31.657 21551 21589 E AndroidRuntime: java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.String.length()' on a null object reference
01-01 22:18:31.657 21551 21589 E AndroidRuntime: at java.net.URLEncoder.encode(URLEncoder.java:205)
01-01 22:18:31.657 21551 21589 E AndroidRuntime: at net.fabiszewski.ulogger.WebHelper.postWithParams(WebHelper.java:142)
01-01 22:18:31.657 21551 21589 E AndroidRuntime: at net.fabiszewski.ulogger.WebHelper.postPosition(WebHelper.java:241)
01-01 22:18:31.657 21551 21589 E AndroidRuntime: at net.fabiszewski.ulogger.WebSyncService.doSync(WebSyncService.java:153)
01-01 22:18:31.657 21551 21589 E AndroidRuntime: at net.fabiszewski.ulogger.WebSyncService.onHandleIntent(WebSyncService.java:99)
01-01 22:18:31.657 21551 21589 E AndroidRuntime: at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:68)
01-01 22:18:31.657 21551 21589 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:102)
01-01 22:18:31.657 21551 21589 E AndroidRuntime: at android.os.Looper.loop(Looper.java:154)
01-01 22:18:31.657 21551 21589 E AndroidRuntime: at android.os.HandlerThread.run(HandlerThread.java:61)
01-01 22:18:31.660 10301 2382 W ActivityManager: Force finishing activity net.fabiszewski.ulogger/.MainActivity
Thanks!
What device is it?
Which android version?
Strange, from your description it seems that you are getting null latitude or longitude, although Android documentation says:
all locations generated by the LocationManager will have a valid longitude and latitude.
I should probably check for null values if that happens.
This is on a Nexus 5 running LineageOS + microg. Thinking about it again, I think this may be due to a bug in the microg backend, which would return null
. The app crash was still very surprising and I did not have much infos about what was happening (and other apps were working fine as far as I can tell, but I think traccar
coalesces it to 0 actually as I was having points with 0,0
coordinates which are obviously wrong).
Not sure about the exact reasons for getting null
values, but if it's not too difficult to check for a null
value, I think it might be worth doing it and simply discarding the point?
I looked at it closer and I think it is not lat
or lon
that causes problem, but missing provider name. Latitude and longitude are probably really zero in this case.
I'll add check for null
provider value.
Thanks!