-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Android/cronet + NativeAdapter = "Too many receivers, total of 1000, registered" #2300
Comments
Hi @brianquinlan. Are you familiar with related restrictions? |
Im encountering the same issue here and I am not even downloading that many files (not 1000+ for sure). How exactly should we go about debugging this issue |
@corepuncher: Could you disable the Android minify to produce a raw stack trace? Also, please help us by providing a minimal runnable example. |
I'm not at work now so excuse me for the short reply; I think that this happens when you create a new CronetEngine (or CronetClient) per request. This is something of an anti-pattern since creating a CronetEngine is quite expensive. |
@brianquinlan Thanks for the insight. I'll look into related paths when available. |
Hello yes, this was happening because I was accidentally running a request for every build. I was using a future builder and I thought that its builder was going to execute only when a state change happens, which is stupid in hindsight. https://api.flutter.dev/flutter/widgets/FutureBuilder-class.html @AlexV525 maybe we can display a short message that points the user to look at any excessive requests. kind of like when you use flex wrong and flutter gives you an error message explaining whats wrong |
@gokturkDev We must investigate with a proper example to understand what is going wrong. Would you be able to provide a reproducible example? |
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
The text was updated successfully, but these errors were encountered: