-
-
Notifications
You must be signed in to change notification settings - Fork 270
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
java.lang.IllegalArgumentException: Too many NetworkRequests filed in Android Nougat(7.1.1). #461
Comments
Hi, Thanks for reporting this issue. It seems to be related to the specific version of the Android OS. It looks like Android is blocking situation, when there is too many network requests. I also don't know how many is "too many" Catching this exception won't solve the problem. I think, in this case you should use observe network only or limit somehow these network checks. Also ensure if you are disposing this disposable in the activity/service lifecycle. If it's not disposed, problems like that may occur very often. Regards, |
Hi @pwittchen Thank you so much your message.
If this issue occur again. I'll let you know. Thanks. |
Hi @pwittchen I fixed above, so this crash count was decreased.
So, If possible to handle that properly within the library to next version, please let me know. |
Thanks for the update. I will try to look into this problem, but at this moment I'm not really sure if it's related to the library code or the Android OS. when registering network callback ( I will try to check it later. Regards, |
For those running into this issue and have minimum SDK 24, the fix is to simply do this, which is what we ended up doing, no need for this library:
This will listen for connectivity changes when the app is in foreground. At this point all you need to do if you want to listen for connectivity changes you just subscribe to Hope it's useful. |
@pwittchen - I'm running into a similar issue - adding the logs from the library if that helps.
|
Running into the same issue an Android wit the following SDK versions: Sadly no way to figure out in which scenario this happens. |
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):
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.
The text was updated successfully, but these errors were encountered: