-
-
Notifications
You must be signed in to change notification settings - Fork 269
Description
Describe the bug
Occur crash when I call the function checkInternetConnectivity().
This is one time issue.
To Reproduce
Steps to reproduce the behavior:
-
call below function
fun checkInternetConnectivity(context: Context): Observable =
ReactiveNetwork.observeNetworkConnectivity(context)
.flatMapSingle { connectivity ->
@Suppress("DEPRECATION")
if (connectivity.state() === NetworkInfo.State.CONNECTED) {
return@flatMapSingle ReactiveNetwork.checkInternetConnectivity()
}
Single.fromCallable { false }
}
.take(1)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread()) -
Log cat error
08-04 14:00:20.685 5771 5771 E MessageQueue-JNI: java.lang.IllegalArgumentException: Too many NetworkRequests filed
08-04 14:00:20.685 5771 5771 E MessageQueue-JNI: at android.os.Parcel.readException(Parcel.java:1688)
08-04 14:00:20.685 5771 5771 E MessageQueue-JNI: at android.os.Parcel.readException(Parcel.java:1637)
08-04 14:00:20.685 5771 5771 E MessageQueue-JNI: at android.net.IConnectivityManager$Stub$Proxy.listenForNetwork(IConnectivityManager.java:2400)
08-04 14:00:20.685 5771 5771 E MessageQueue-JNI: at android.net.ConnectivityManager.sendRequestForNetwork(ConnectivityManager.java:2856)
08-04 14:00:20.685 5771 5771 E MessageQueue-JNI: at android.net.ConnectivityManager.registerNetworkCallback(ConnectivityManager.java:3075)
08-04 14:00:20.685 5771 5771 E MessageQueue-JNI: at com.github.pwittchen.reactivenetwork.library.rx2.network.observing.strategy.MarshmallowNetworkObservingStrategy.observeNetworkConnectivity(MarshmallowNetworkObservingStrategy.java:80)
08-04 14:00:20.685 5771 5771 E MessageQueue-JNI: at com.github.pwittchen.reactivenetwork.library.rx2.ReactiveNetwork.observeNetworkConnectivity(ReactiveNetwork.java:92)
08-04 14:00:20.685 5771 5771 E MessageQueue-JNI: at com.github.pwittchen.reactivenetwork.library.rx2.ReactiveNetwork.observeNetworkConnectivity(ReactiveNetwork.java:73)
08-04 14:00:20.685 5771 5771 E MessageQueue-JNI: at com.kakao.i.sdk.agent.util.CommonUtils.checkInternetConnectivity(CommonUtils.kt:1)
08-04 14:00:20.685 5771 5771 E MessageQueue-JNI: at com.kakao.i.sdk.agent.AgentService.checkInternetAndAction(AgentService.kt:1)
08-04 14:00:20.685 5771 5771 E MessageQueue-JNI: at com.kakao.i.sdk.agent.AgentService.checkInternetAndAction$default(AgentService.kt:1)
08-04 14:00:20.685 5771 5771 E MessageQueue-JNI: at com.kakao.i.sdk.agent.AgentService.requestRecognition(AgentService.kt:2)
08-04 14:00:20.685 5771 5771 E MessageQueue-JNI: at com.kakao.i.sdk.agent.AgentService.access$requestRecognition(AgentService.kt:1)
08-04 14:00:20.685 5771 5771 E MessageQueue-JNI: at com.kakao.i.sdk.agent.AgentService$f.a(AgentService.kt:2)
08-04 14:00:20.685 5771 5771 E MessageQueue-JNI: at com.kakao.i.sdk.agent.AgentService$f.invoke(AgentService.kt:1)
08-04 14:00:20.685 5771 5771 E MessageQueue-JNI: at com.kakao.i.sdk.agent.floating.a$a.a(FloatingAgentViewManager.kt:2)
08-04 14:00:20.685 5771 5771 E MessageQueue-JNI: at com.kakao.i.sdk.agent.floating.FloatingAgentView$b.onSingleTapUp(FloatingAgentView.kt:1)
08-04 14:00:20.685 5771 5771 E MessageQueue-JNI: at android.view.GestureDetector.onTouchEvent(GestureDetector.java:635)
08-04 14:00:20.685 5771 5771 E MessageQueue-JNI: at com.kakao.i.sdk.agent.floating.FloatingAgentView.onTouch(FloatingAgentView.kt:1)
08-04 14:00:20.685 5771 5771 E MessageQueue-JNI: at android.view.View.dispatchTouchEvent(View.java:10019)
08-04 14:00:20.685 5771 5771 E MessageQueue-JNI: at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2626)
08-04 14:00:20.685 5771 5771 E MessageQueue-JNI: at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2307)
08-04 14:00:20.685 5771 5771 E MessageQueue-JNI: at android.view.View.dispatchPointerEvent(View.java:10243)
08-04 14:00:20.685 5771 5771 E MessageQueue-JNI: at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:4438)
08-04 14:00:20.685 5771 5771 E MessageQueue-JNI: at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4306)
08-04 14:00:20.685 5771 5771 E MessageQueue-JNI: at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3853)
08-04 14:00:20.685 5771 5771 E MessageQueue-JNI: at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3906)
08-04 14:00:20.685 5771 5771 E MessageQueue-JNI: at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3872)
08-04 14:00:20.685 5771 5771 E MessageQueue-JNI: at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:3999)
08-04 14:00:20.685 5771 5771 E MessageQueue-JNI: at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3880)
08-04 14:00:20.685 5771 5771 E MessageQueue-JNI: at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:4056)
08-04 14:00:20.685 5771 5771 E MessageQueue-JNI: at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3853)
08-04 14:00:20.685 5771 5771 E MessageQueue-JNI: at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3906)
08-04 14:00:20.685 5771 5771 E MessageQueue-JNI: at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3872)
08-04 14:00:20.685 5771 5771 E MessageQueue-JNI: at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3880)
08-04 14:00:20.685 5771 5771 E MessageQueue-JNI: at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3853)
08-04 14:00:20.685 5771 5771 E MessageQueue-JNI: at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:6246)
08-04 14:00:20.685 5771 5771 E MessageQueue-JNI: at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:6220)
08-04 14:00:20.685 5771 5771 E MessageQueue-JNI: at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:6181)
08-04 14:00:20.685 5771 5771 E MessageQueue-JNI: at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:6349)
08-04 14:00:20.685 5771 5771 E MessageQueue-JNI: at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:185)
08-04 14:00:20.685 5771 5771 E MessageQueue-JNI: at android.os.MessageQueue.nativePollOnce(Native Method)
08-04 14:00:20.685 5771 5771 E MessageQueue-JNI: at android.os.MessageQueue.next(MessageQueue.java:323)
08-04 14:00:20.685 5771 5771 E MessageQueue-JNI: at android.os.Looper.loop(Looper.java:136)
08-04 14:00:20.685 5771 5771 E MessageQueue-JNI: at android.app.ActivityThread.main(ActivityThread.java:6119)
08-04 14:00:20.685 5771 5771 E MessageQueue-JNI: at java.lang.reflect.Method.invoke(Native Method)
08-04 14:00:20.685 5771 5771 E MessageQueue-JNI: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:982)
08-04 14:00:20.685 5771 5771 E MessageQueue-JNI: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:872)
08-04 14:00:20.691 5771 5771 D AndroidRuntime: Shutting down VM
--------- beginning of crash
Smartphone (please complete the following information):
- Device: tablet
- OS: Android 7.1.1
- Library Version: 3.0.8
Additional context
I think this issue because of only nougat OS like below.
https://stackoverflow.com/questions/41957895/android-nougat-too-many-networkrequests-filed
But I want to protect the crash.
So could you please catch this exception in library?
Thanks.