Android/cronet + NativeAdapter = "Too many receivers, total of 1000, registered" #2300
Labels
h: need extra help
Extra help is needed
p: native_dio_adapter
Targeting `native_dio_adapter` package
platform: io
s: bug
Something isn't working
Package
native_dio_adapter
Version
1.3.0
Operating-System
Android
Adapter
NativeAdapter
Output of
flutter doctor -v
Dart Version
3.5.2
Steps to Reproduce
When using a map tiler (flutter map) with many tile layers, a limit is reached regarding "Broadcast Receivers" for Android when using NativeAdapter().
"Too many receivers, total of 1000, registered"
So I guess to reproduce, just request too many files over a network in a short period.
Expected Result
All network requests should be honored when using the NativeAdapter packge.
NOTE: if I do NOT use NativeAdapter, and just http, everything works fine for Android. However, the network requests are not as fast as with cronet, so I would rather have NativeAdapter adjusted to allow for > 1000. Or, if you could provide me with a method to "Unregister" or prevent these receivers, that would be great!
Actual Result
java.lang.IllegalStateException: Too many receivers, total of 1000, registered for pid: 27102, callerPackage: com.asdf.asdf
E/cr_JniAndroid(27102): at android.os.Parcel.createExceptionOrNull(Parcel.java:3077)
E/cr_JniAndroid(27102): at android.os.Parcel.createException(Parcel.java:3053)
E/cr_JniAndroid(27102): at android.os.Parcel.readException(Parcel.java:3036)
E/cr_JniAndroid(27102): at android.os.Parcel.readException(Parcel.java:2978)
E/cr_JniAndroid(27102): at android.app.IActivityManager$Stub$Proxy.registerReceiverWithFeature(IActivityManager.java:6157)
E/cr_JniAndroid(27102): at android.app.ContextImpl.registerReceiverInternal(ContextImpl.java:1913)
E/cr_JniAndroid(27102): at android.app.ContextImpl.registerReceiver(ContextImpl.java:1860)
E/cr_JniAndroid(27102): at android.content.ContextWrapper.registerReceiver(ContextWrapper.java:791)
E/cr_JniAndroid(27102): at m.ha.c(:com.google.android.gms.dynamite_cronetdynamite@[email protected] (190400-0):7)
E/cr_JniAndroid(27102): at m.ha.a(:com.google.android.gms.dynamite_cronetdynamite@[email protected] (190400-0):2)
E/cr_JniAndroid(27102): at org.chromium.net.ProxyChangeListener.start(:com.google.android.gms.dynamite_cronetdynamite@[email protected] (190400-0):56)
E/cr_JniAndroid(27102): at J.N.M6Dz0nZ5(Native Method)
E/cr_JniAndroid(27102): at m.lv.run(:com.google.android.gms.dynamite_cronetdynamite@[email protected] (190400-0):10)
E/cr_JniAndroid(27102): at android.os.Handler.handleCallback(Handler.java:958)
E/cr_JniAndroid(27102): at android.os.Handler.dispatchMessage(Handler.java:99)
E/cr_JniAndroid(27102): at android.os.Looper.loopOnce(Looper.java:230)
E/cr_JniAndroid(27102): at android.os.Looper.loop(Looper.java:319)
E/cr_JniAndroid(27102): at android.os.HandlerThread.run(HandlerThread.java:67)
E/cr_JniAndroid(27102): Caused by: android.os.RemoteException: Remote stack trace:
E/cr_JniAndroid(27102): at com.android.server.am.ActivityManagerService.registerReceiverWithFeature(ActivityManagerService.java:16762)
E/cr_JniAndroid(27102): at android.app.IActivityManager$Stub.onTransact$registerReceiverWithFeature$(IActivityManager.java:11613)
E/cr_JniAndroid(27102): at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:2961)
E/cr_JniAndroid(27102): at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:3199)
E/cr_JniAndroid(27102): at android.os.Binder.execTransactInternal(Binder.java:1375)
E/cr_JniAndroid(27102):
E/AndroidRuntime(27102): FATAL EXCEPTION: CronetInit
E/AndroidRuntime(27102): Process: com.asdf.asdf, PID: 27102
E/AndroidRuntime(27102): m.hg: Native stack trace:
E/AndroidRuntime(27102):
E/AndroidRuntime(27102): at org.chromium.base.JniAndroid.handleException(:com.google.android.gms.dynamite_cronetdynamite@[email protected] (190400-0):10)
E/AndroidRuntime(27102): at J.N.M6Dz0nZ5(Native Method)
E/AndroidRuntime(27102): at m.lv.run(:com.google.android.gms.dynamite_cronetdynamite@[email protected] (190400-0):10)
E/AndroidRuntime(27102): at android.os.Handler.handleCallback(Handler.java:958)
E/AndroidRuntime(27102): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(27102): at android.os.Looper.loopOnce(Looper.java:230)
E/AndroidRuntime(27102): at android.os.Looper.loop(Looper.java:319)
E/AndroidRuntime(27102): at android.os.HandlerThread.run(HandlerThread.java:67)
E/AndroidRuntime(27102): Caused by: java.lang.IllegalStateException: Too many receivers, total of 1000, registered for pid: 27102, callerPackage: com.asdf.asdf
E/AndroidRuntime(27102): at android.os.Parcel.createExceptionOrNull(Parcel.java:3077)
E/AndroidRuntime(27102): at android.os.Parcel.createException(Parcel.java:3053)
E/AndroidRuntime(27102): at android.os.Parcel.readException(Parcel.java:3036)
E/AndroidRuntime(27102): at android.os.Parcel.readException(Parcel.java:2978)
E/AndroidRuntime(27102): at android.app.IActivityManager$Stub$Proxy.registerReceiverWithFeature(IActivityManager.java:6157)
E/AndroidRuntime(27102): at android.app.ContextImpl.registerReceiverInternal(ContextImpl.java:1913)
E/AndroidRuntime(27102): at android.app.ContextImpl.registerReceiver(ContextImpl.java:1860)
E/AndroidRuntime(27102): at android.content.ContextWrapper.registerReceiver(ContextWrapper.java:791)
E/AndroidRuntime(27102): at m.ha.c(:com.google.android.gms.dynamite_cronetdynamite@[email protected] (190400-0):7)
E/AndroidRuntime(27102): at m.ha.a(:com.google.android.gms.dynamite_cronetdynamite@[email protected] (190400-0):2)
E/AndroidRuntime(27102): at org.chromium.net.ProxyChangeListener.start(:com.google.android.gms.dynamite_cronetdynamite@[email protected] (190400-0):56)
E/AndroidRuntime(27102): ... 7 more
E/AndroidRuntime(27102): Caused by: android.os.RemoteException: Remote stack trace:
E/AndroidRuntime(27102): at com.android.server.am.ActivityManagerService.registerReceiverWithFeature(ActivityManagerService.java:16762)
E/AndroidRuntime(27102): at android.app.IActivityManager$Stub.onTransact$registerReceiverWithFeature$(IActivityManager.java:11613)
E/AndroidRuntime(27102): at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:2961)
E/AndroidRuntime(27102): at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:3199)
E/AndroidRuntime(27102): at android.os.Binder.execTransactInternal(Binder.java:1375)
The text was updated successfully, but these errors were encountered: