-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[Android] NullPointerException in ConnectivityReceiver => onConnectivityChanged #6838
Comments
Thank your for reporting, I think the use-case will be destroying the underlying map object and at the same time still receiving connectivity change events. Added a check to validate if the map isn't destroyed should resolve this. |
Is this bugfix already in a release? I searched the notes, but couldn't find anything. |
This was released in 4.2.0 and 4.2.1 |
Thank you, tobrun. |
@tobrun Are you sure this fix was included in 4.2.1? |
@fab1an I was tried to build a custom package with Jitpack but it's not compiles libmapbox-gl.so library (it is originally compiling with Bitrise as i know) |
+1 - We're seeing a significant amount of crashes relating to this. |
Is there an easy way to backport this to 4.1.1? |
We also face this issue. |
Thank you all for reaching out and requesting this fix, we are currently thinking about a 4.2.2 bugfix release that would include a fix for this issue. Will update the ticket if there is a concrete eta. |
@tobrun That sounds good. If the version still takes some time, however, do you think you could help us make a custom build ourselves? |
Update as we are planning a |
Platform: Android
Mapbox SDK version: com.mapbox.mapboxsdk:mapbox-android-sdk:4.1.1
Just got a crashreport in Crashlytics raising a Null Pointer Exception:
Image ( Looks better ):
It's on a Customer Device in Production - so i don't know how to reproduce, but maybe this helps.
Full Stacktrace:
Fatal Exception: java.lang.RuntimeException: Error receiving broadcast Intent { act=android.net.conn.CONNECTIVITY_CHANGE flg=0x4000010 (has extras) } in com.mapbox.mapboxsdk.maps.MapView$ConnectivityReceiver@23951ec3 at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:876) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5254) at java.lang.reflect.Method.invoke(Method.java) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:902) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:697) Caused by java.lang.NullPointerException: Attempt to invoke virtual method 'void com.mapbox.mapboxsdk.maps.NativeMapView.setReachability(boolean)' on a null object reference at com.mapbox.mapboxsdk.maps.MapView.onConnectivityChanged(MapView.java:2357) at com.mapbox.mapboxsdk.maps.MapView.access$3100(MapView.java:115) at com.mapbox.mapboxsdk.maps.MapView$ConnectivityReceiver.onReceive(MapView.java:2342) at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:866) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5254) at java.lang.reflect.Method.invoke(Method.java) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:902) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:697)
The text was updated successfully, but these errors were encountered: