plaidev / karte-android-sdk

KARTE SDK for Android
https://karte.io/
Apache License 2.0
5 stars 3 forks source link

[core] App crashes rarely when the network state is switched during SDK initialization. #4

Closed wasnot closed 4 years ago

wasnot commented 4 years ago

Expected Behavior

Application can launch without crash.

Current Behavior

Application will crash when launching for a few users, when network state is switched.

Possible Solution

This issue has been fixed in core 2.3.2. https://developers.karte.io/docs/release-notes-android-sdk-v2#releases---20200625

Steps to Reproduce

We can not reproduce this problem on our environment. (it detected on crashlytics)

Context (Environment)

dependencies {
  implementation 'io.karte.android:core:2.3.0'
}

Detailed Description

Crash log

Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.os.Handler.postDelayed(java.lang.Runnable, long)' on a null object reference
       at io.karte.android.tracking.queue.Dispatcher.setSuspend(Dispatcher.java:87)
       at io.karte.android.tracking.queue.Dispatcher.connectivity(Dispatcher.java:55)
       at io.karte.android.tracking.queue.Dispatcher.access$connectivity(Dispatcher.java:47)
       at io.karte.android.tracking.queue.Dispatcher$1.invoke(Dispatcher.java:50)
       at io.karte.android.tracking.queue.Dispatcher$1.invoke(Dispatcher.java:47)
       at io.karte.android.utilities.connectivity.ConnectivityObserver.flush(ConnectivityObserver.java:108)
       at io.karte.android.utilities.connectivity.ConnectivityObserver.access$flush(ConnectivityObserver.java:55)
       at io.karte.android.utilities.connectivity.ConnectivityObserver$2.onAvailable(ConnectivityObserver.java:87)
       at android.net.ConnectivityManager$NetworkCallback.onAvailable(ConnectivityManager.java:3512)
       at android.net.ConnectivityManager$CallbackHandler.handleMessage(ConnectivityManager.java:3711)
       at android.os.Handler.dispatchMessage(Handler.java:106)
       at android.os.Looper.loop(Looper.java:205)
       at android.os.HandlerThread.run(HandlerThread.java:65)

Possible Implementation

wasnot commented 4 years ago

duplicated #2