onnela-lab / beiwe-android

Beiwe is a smartphone-based digital phenotyping research platform. This is the Beiwe Android app code. The Beiwe2 app is also available on the Google Play store to use with open source builds of the Beiwe backend.
https://www.beiwe.org/
BSD 3-Clause "New" or "Revised" License
26 stars 16 forks source link

Resume RegisterActivity NullPointerException #35

Closed zagorsky closed 6 years ago

zagorsky commented 6 years ago

https://sentry.io/onnela-lab/production/issues/551406885/

Stack trace from Sentry:

Android Error: Unable to resume activity {org.beiwe.app/org.beiwe.app.ui.registration.RegisterActivity}
Error message: Unable to resume activity {org.beiwe.app/org.beiwe.app.ui.registration.RegisterActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.String.length()' on a null object reference
Error type: class java.lang.RuntimeException
Error-fill:
    org.beiwe.app.CrashHandler.writeCrashlog(CrashHandler.java:77)
    org.beiwe.app.CrashHandler.uncaughtException(CrashHandler.java:33)
    java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1068)
    java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1063)
Actual Error:
    org.beiwe.app.storage.EncryptionEngine.unsafeHash(EncryptionEngine.java:61)
    org.beiwe.app.storage.EncryptionEngine.safeHash(EncryptionEngine.java:44)
    org.beiwe.app.DeviceInfo.initialize(DeviceInfo.java:67)
    org.beiwe.app.ui.registration.RegisterActivity.onResume(RegisterActivity.java:200)
    android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1270)
    android.app.Activity.performResume(Activity.java:6824)
    android.app.ActivityThread.performResumeActivity(ActivityThread.java:3406)
    android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3469)
    android.app.ActivityThread$H.handleMessage(ActivityThread.java:1527)
    android.os.Handler.dispatchMessage(Handler.java:102)
    android.os.Looper.loop(Looper.java:154)
    android.app.ActivityThread.main(ActivityThread.java:6119)
    java.lang.reflect.Method.invoke(Native Method)
    com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
    com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)

This Sentry error, which has a truncated stack trace, may be the same crash: https://sentry.io/onnela-lab/production/issues/432738611/

sesterki commented 6 years ago

Fixed in commit 3fcf089b66e838acea76d7d727ff79f078e40098

zagorsky commented 6 years ago

Pretty sure this is the same issue as #25. This happened on an Android 7 phone, but maybe it was one that had a null Bluetooth MAC address.