ostrya / PresencePublisher

An Android MQTT client that regularly publishes messages to notify about the device's presence
MIT License
79 stars 12 forks source link

Crashes immediately after "Found beacon" - NullPointerException #25

Closed hubertbanas closed 4 years ago

hubertbanas commented 4 years ago

Presence Publisher v2.1.0 Pixel 2 - Android 10 iBeacon - NodeMCU-32S running ESPHome

Log snippet

2020-09-08T18:54:45.790Z [INFO/BeaconScanDialogFragment]: Got callback from beacon scan for region id1: null id2: null id3: null
2020-09-08T18:54:45.790Z [INFO/BeaconScanDialogFragment]: Found beacon id1: e07d0c40-6ef6-4eed-a3a7-89129fe0ca1d id2: 3104 id3: 1 type iBeacon
2020-09-08T18:54:45.791Z [ERROR/LogUncaughtExceptionHandler]: Thread[main,5,main] crashed due to java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.String.compareTo(java.lang.String)' on a null object reference
        at org.ostrya.presencepublisher.l.m.j$c.j(Unknown Source:22)
        at org.ostrya.presencepublisher.l.m.j$c.compare(Unknown Source:4)
        at androidx.recyclerview.widget.s.d(Unknown Source:12)
        at androidx.recyclerview.widget.s.b(Unknown Source:8)
        at androidx.recyclerview.widget.s.a(Unknown Source:4)
        at org.ostrya.presencepublisher.l.m.j.B(Unknown Source:2)
        at org.ostrya.presencepublisher.l.m.k$c.a(Unknown Source:76)
        at org.altbeacon.beacon.i.a(Unknown Source:122)
        at org.altbeacon.beacon.e$a.onReceive(Unknown Source:5)
        at b.k.a.a.a(Unknown Source:59)
        at b.k.a.a$a.handleMessage(Unknown Source:11)
        at android.os.Handler.dispatchMessage(Handler.java:107)
        at android.os.Looper.loop(Looper.java:214)
        at android.app.ActivityThread.main(ActivityThread.java:7356)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)

Full log is located at https://easyupload.io/nara9n

ostrya commented 4 years ago

Thanks for your patience. Seems I should have had that final test run before the release.

Here's a new version that should hopefully fix the NPE: app-debug.zip

hubertbanas commented 4 years ago

Attached app-debug.zip will not install for some reason.

ostrya commented 4 years ago

Huh. Must have packaged an IDE build instead of a gradle build. Should work now: app-debug.zip

hubertbanas commented 4 years ago

Looking good. Thank you!