Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullPointerException on Android 4.3.1 #32

Closed
3 of 4 tasks
MBach opened this issue Mar 5, 2018 · 4 comments
Closed
3 of 4 tasks

NullPointerException on Android 4.3.1 #32

MBach opened this issue Mar 5, 2018 · 4 comments
Assignees

Comments

@MBach
Copy link

MBach commented Mar 5, 2018

Prerequisites

  • My beacons have Estimote Monitoring enabled (Check it in the Estimote Cloud, or via app)
  • My Android device/devices supports BLE and has Android OS version >= 5.0.0
  • My Android device/devices have bluetooth enabled
  • My app has Location Permissions granted

Basic information

Estimote SDK version: 0.3.3

Android devices affected: Motorola Defy Mini (XT320)

Android OS version affected: 4.3.1 (latest major upgrade for this phone)

Beacon hardware version: F3.3

Description

According to Crashlytics, we have monitored an old phone whose crashing when receiving a notification.

NullPointerException's are like game overs 🎮

I'm not sure if it's a real bug because:

  • it's a really old phone
  • it seems to support only Bluetooth 2.1, and I cannot find any BLE mention

Additional information

Fatal Exception: java.lang.RuntimeException: Unable to start receiver com.estimote.proximity_sdk.trigger.TriggerBroadcastReceiver: java.lang.NullPointerException
       at android.app.ActivityThread.handleReceiver(ActivityThread.java:2431)
       at android.app.ActivityThread.access$1500(ActivityThread.java:141)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1332)
       at android.os.Handler.dispatchMessage(Handler.java:99)
       at android.os.Looper.loop(Looper.java:137)
       at android.app.ActivityThread.main(ActivityThread.java:5103)
       at java.lang.reflect.Method.invokeNative(Method.java)
       at java.lang.reflect.Method.invoke(Method.java:525)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java)
       at dalvik.system.NativeStart.main(NativeStart.java)

and

Caused by java.lang.NullPointerException
       at android.app.NotificationManager.notify(NotificationManager.java:128)
       at com.estimote.proximity_sdk.trigger.TriggerBroadcastReceiver.postNotification(TriggerBroadcastReceiver.kt:25)
       at com.estimote.proximity_sdk.trigger.TriggerBroadcastReceiver.onReceive(TriggerBroadcastReceiver.kt:18)
       at android.app.ActivityThread.handleReceiver(ActivityThread.java:2424)
       at android.app.ActivityThread.access$1500(ActivityThread.java:141)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1332)
       at android.os.Handler.dispatchMessage(Handler.java:99)
       at android.os.Looper.loop(Looper.java:137)
       at android.app.ActivityThread.main(ActivityThread.java:5103)
       at java.lang.reflect.Method.invokeNative(Method.java)
       at java.lang.reflect.Method.invoke(Method.java:525)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java)
       at dalvik.system.NativeStart.main(NativeStart.java)
@pawelDylag
Copy link
Contributor

pawelDylag commented Mar 5, 2018

Thanks @MBach, the NPE was kinda similar to the previous #21 issue. Will be fixed in the next release. Anyway - I'm not sure how exactly this happened on Android 4.3.1 - ProximityTriggerBuilder should not allow to build a full ProximityTrigger on phones with Android below API 26. Were you calling the TriggerBroadcastReceiver by yourself?

Regards,
Paweł

@pawelDylag pawelDylag self-assigned this Mar 5, 2018
@MBach
Copy link
Author

MBach commented Mar 5, 2018

I'm not calling TriggerBroadcastReceiver by myself. I don't even call ProximityTriggerBuilder nor ProximityTrigger. I just compile with latest SDK (targetSdkVersion, compileSdkVersion 27) and set minSdkVersion to 18, which is Android 4.3

@pawelDylag
Copy link
Contributor

Okay, seems like the receiver is getting called by the system. Anyway the fix is scheduled for the next release - there shouldn't be any NPE anymore.

@pawelDylag
Copy link
Contributor

Hey @MBach - this should be fixed in 0.4.1 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants