NightWatch
NightWatch copied to clipboard
Crashes with Xiaomi Redmi Note 4
Application was working well, but lately It has been crashing many times per day. My phone is using androind 7.0 version.
I'm using latest nightscout and uploader for medtronic series 600.
case: application stops updating my watch and application data and after that giving notification about crash.
logs:
java.lang.RuntimeException: Unable to start service com.dexdrip.stephenblack.nightwatch.WatchUpdaterService@19a811a with Intent { cmp=com.dexdrip.stephenblack.nightwatch/.WatchUpdaterService (has extras) }: java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.String.compareTo(java.lang.String)' on a null object reference at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3372) at android.app.ActivityThread.-wrap21(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1611) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:163) at android.app.ActivityThread.main(ActivityThread.java:6237) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:877) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767) Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.String.compareTo(java.lang.String)' on a null object reference at com.dexdrip.stephenblack.nightwatch.Bg.slopeArrow(Bg.java:157) at com.dexdrip.stephenblack.nightwatch.Bg.dataMap(Bg.java:194) at com.dexdrip.stephenblack.nightwatch.WatchUpdaterService.sendData(WatchUpdaterService.java:137) at com.dexdrip.stephenblack.nightwatch.WatchUpdaterService.onStartCommand(WatchUpdaterService.java:100) at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3355) ... 8 more
Nightscout 0.10.2 and 640G uploader indra 0.6.0.
This could be somehow related to new features in Indra 0.6.0( History sync). Based on short experience it looks like crash is not occuring if sync feature is disabled.
I found workaround for this problem. Problem occures, if new uploader feature "Enable CGM History" is used. This came to uploader version 0.6.0, which backfills missed CGM data. Somehow Nightwatch cannot handle this and gives exception. If feature is disabled, nightwatch can be used. I didn't check yet how to fix this problem.
I'm experiencing the same issues with a Motorola G4, running Android 7.0. This was both with the 0.6.0 uploader, and with the just released 0.6.1. I've tried switching off the history, uninstalling and re-installing, clearing cache, but these haven't solved the issue. I'm unable to open Nightwatch any more.
However... I am able to run it with an Amazon Fire 7 tablet, 7th Gen.
I haven't seen this anymore after disabling "Enable CGM history". However, I had to also uninstall and reinstall nightwatch to get it working after enabling "CGM history" first time with uploader 0.6.0. I noticed, that every time when uploader missed some data and did CGM history filling nightwatch was crashed. Threadment history can be active, because that data is not shown in nightwatch. I'm also using 0.6.1 now and I will get data to app, but also to my watch. Missed CGM data is not filled, but I can live with that. However, there is definitely bug, which needs to be debugged.
Thanks, that Enable CGM history tip has helped me. The additional issue I had I've now found. Just uninstalling and re-installing Nightwatch wasn't sufficient - I also had to manually clear data and cache from the app, otherwise it picked up old info and refused to open. I agree, missing CGM data isn't a big issue compared to missing Nightwatch, but there is a minor bug here.
I was investigating this today and it looks like the problem could be the same as in issue : Crash on URL Load #78
The proposed fix is still missing from branches, but I was testing this today with my own build/APK. I will do some more testing and if everything goes ok, I will try to push this to GIT. I found also some other challenges when trying to launch my own APK, but got APK working after disabling "Instant run".
Crash is not happening anymore after adding fix ae3f8c1
would you do a PR please?
Hopefully PR is ok now. I have made also some other things (fifth watchface with IoB), but maybe pushing those later. I would like to add also pump status to watchface via devicestatus API
Thanks seittenj. Hope someone with the skills and access can review your proposal soon?