NightWatch icon indicating copy to clipboard operation
NightWatch copied to clipboard

Crash on URL Load

Open sjolundjohn opened this issue 8 years ago • 14 comments

Hi,

I am having a issue with crash as soon as I enter the URL for my Nightscout site. Galaxy S5 Working Nightscout install

Sequence: Install app (I have tried x3 versions back) Enter settings Test modifying settings (such as switching to mmol) OR not modifying anything Enter URL to NightScout As soon as I hit save it crashes right away Unable to recover and open app Must go into Application settings to clear app data I can then try again, but same thing keeps happening.

Seems the https connection is causing a crash.

Any thoughts?

sjolundjohn avatar Mar 27 '16 15:03 sjolundjohn

From Android Studio in case this helps??

03-29 17:30:36.080 3706-3706/com.dexdrip.stephenblack.nightwatch E/AndroidRuntime: FATAL EXCEPTION: main Process: com.dexdrip.stephenblack.nightwatch, PID: 3706 java.lang.RuntimeException: Unable to resume activity {com.dexdrip.stephenblack.nightwatch/com.dexdrip.stephenblack.nightwatch.Home}: 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.performResumeActivity(ActivityThread.java:2951) at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2982) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2365) at android.app.ActivityThread.access$800(ActivityThread.java:144) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5221) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694) 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:153) at com.dexdrip.stephenblack.nightwatch.Home.displayCurrentInfo(Home.java:201) at com.dexdrip.stephenblack.nightwatch.Home.onResume(Home.java:98) at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1241) at android.app.Activity.performResume(Activity.java:6023) at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2940) at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2982)  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2365)  at android.app.ActivityThread.access$800(ActivityThread.java:144)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)  at android.os.Handler.dispatchMessage(Handler.java:102)  at android.os.Looper.loop(Looper.java:135)  at android.app.ActivityThread.main(ActivityThread.java:5221)  at java.lang.reflect.Method.invoke(Native Method)  at java.lang.reflect.Method.invoke(Method.java:372)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)  03-29 17:30:36.770 3706-3872/com.dexdrip.stephenblack.nightwatch I/Fabric: Crashlytics report upload complete: 56FA9F8900F0-0003-0987-CED7A12453BB.cls 03-29 17:31:13.380 3706-3713/com.dexdrip.stephenblack.nightwatch W/art: Suspending all threads took: 10ms

sjolundjohn avatar Mar 29 '16 15:03 sjolundjohn

Hi, as you are using Studio and self-compile:

Could you do the following changes here: https://github.com/StephenBlackWasAlreadyTaken/NightWatch/blob/master/mobile/src/main/java/com/dexdrip/stephenblack/nightwatch/Bg.java#L156

Between String arrow = "--"; and if (direction.compareTo("DoubleDown") == 0)... { please add the line:

if(direction == null) return arrow;

... and please report back if that helps.

AdrianLxM avatar Mar 29 '16 18:03 AdrianLxM

Did you updated git hub source?

On Tue, Mar 29, 2016, 2:35 PM AdrianLxM [email protected] wrote:

Hi, as you are using Studio and self-compile:

Could you do the following changes here: https://github.com/StephenBlackWasAlreadyTaken/NightWatch/blob/master/mobile/src/main/java/com/dexdrip/stephenblack/nightwatch/Bg.java#L156

Between String arrow = "--"; and if (direction.compareTo("DoubleDown") == 0)... { please add the line:

if(direction == null) return arrow;

... and please report back if that helps.

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/StephenBlackWasAlreadyTaken/NightWatch/issues/78#issuecomment-203041117

bw396704 avatar Mar 29 '16 18:03 bw396704

@bw396704, @sjolundjohn didn't even respond yet. 12 minutes is a bit short for him to test that ;)

AdrianLxM avatar Mar 29 '16 18:03 AdrianLxM

Hi - I was able to test the change and it worked successfully on my phone / device, no crash.

I was not able to get the watchfaces installed on my phone, but this may be due to a problem with how I built the APX in Android Studio.

I attempted to commit the file to Git, though am a beginner at Android Studio etc. so not sure that it went in correctly.

If somebody can rebuild into a new version hopefully we solved it.

sjolundjohn avatar Mar 30 '16 08:03 sjolundjohn

Hi, watchfaces also confirmed to be working after signing APX before build.

Didn't figure out how to commit / patch / pull, but change should be easy to make. If anybody wants to provide instructions happy to help.

sjolundjohn avatar Mar 30 '16 13:03 sjolundjohn

@sjolundjohn, I can do that when I come to it.

One more question: what do you use as uploader?

AdrianLxM avatar Mar 30 '16 15:03 AdrianLxM

@AdrianLxM it would be great if you could provide some tips on how to commit changes / pull requests via Android Uploader - I couldn't figure it out.

Uploader - I have a 640g pump so using a solution built by @LittleDMatt

sjolundjohn avatar Mar 30 '16 15:03 sjolundjohn

@sjolundjohn, I have never worked with git from an android phone. The easiest way would be to use a Desktop/Laptop. On Github you can simply change the file. If you have no merge rights in the repository, it will suggest generating a branch in your forked repository (or even do a fork) plus a pull request instead.

AdrianLxM avatar Mar 30 '16 15:03 AdrianLxM

@AdrianLxM it is in Android Studio that I made the changes. Thanks!

sjolundjohn avatar Mar 30 '16 15:03 sjolundjohn

Ah, now I understand why this data was missing on which it crashed trying to access.

AdrianLxM avatar Mar 30 '16 15:03 AdrianLxM

@sjolundjohn: simply go into the directory you cloned your fork to. Call git add on these files and then push them back to your repository on github. Then you can simply press the button to compare and generate a pull request on the github website.

AdrianLxM avatar Mar 30 '16 15:03 AdrianLxM

Hello, as further confirmation: I had the same issue, and the fix mentioned above worked for me as well. Thank you!

andrew-warrington avatar May 28 '16 13:05 andrew-warrington

I'm having the same issue with version 2.0.4_2. Is any workaround? I don't have the compiler to modify the source code :(

juanpmartin avatar Feb 27 '17 03:02 juanpmartin