-
Notifications
You must be signed in to change notification settings - Fork 6.2k
java.lang.IllegalArgumentException: register too many Broadcast Receivers #1161
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
Comments
Sorry about the delay... Yes, v4 is ought to have more features than v3... That setter was introduced in #709 so you can either move yourself forward to the v4 snapshot or backport that change if you really want it in This looks like a vendor issue, right? So it's not a widespread problem. Do you really end up with too many Broadcast Receivers or the framework on that device is too touchy? You may be able to reduce the number of receivers if you use the activity context to load with Glide, because it will reduce the number of |
This issue has been automatically marked as stale because it has not had activity in the last seven days. It will be closed if no further activity occurs within the next seven days. Thank you for your contributions. |
I just happened to get this exception using the latest version of glide (4.4.0) Attached the stacktrace:
Lines are wrong due to proguard, but the method namess should be correct. |
I don't object to try/catch since we're already doing that. I'm curious to know though whether this means that there's some other bug causing receivers not to be unregistered (either in Glide or in the application). It's probably unlikely if this only happens on one specific device, but it's a strange exception. |
I don't see any instances of this in applications I work on. A better solution might be to pull the broadcast receiver registration (or even the connectivity monitor) up to the top level Glide singleton. Right now there's one per RequestManager, which means one per Fragment or Activity. If you have a sufficiently large number of Activitys stacked on top of each other or a sufficiently large number of Fragments within a single Activity, you could end up with quite a few programatically registered receivers. |
@seviu are you interested in working on this? |
@sjudd I have been away for a few days and I could not answer sooner. However I would love to take a look at it. |
This is the bug of huawei's mobile phone system. Huawei's mobile phone has a white list mechanism. Only the APP in their white list can avoid this bug. I use reflection to try to solve this bug. How to usagedependencies {
// add dependencies
implementation 'com.llew.huawei:verifier:1.0.2'
} public class SimpleApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
LoadedApkHuaWei.hookHuaWeiVerifier(getBaseContext());
}
} That all |
@seviu no problem, let me know if you're planning on sending a pull request. |
it's Huawei bug. Only crash in huawei |
…tivityMonitor.java register too many Broadcast Receivers bumptech#1161 receiver is alter static
@llew2011 I used your method, but still reported an error, Chinese users |
it also crash in SM G9650 and one plus A5000. |
I tried. It didn't work |
latest version is 1.1.1 |
@sjudd About the problem. Could we try catch the exception in the class |
I find a way that may case this crash 。 |
We are also facing same Issue of glide. Glide Version : 4.11 Description : We are using BaseActivity to load image and using base activity context. here is code snippet...
Stack Trace Log Cat:
Is there any device specific issue? Please help us to solve this issue. |
Fixes #1161 PiperOrigin-RevId: 397118826
Fixes #1161 PiperOrigin-RevId: 397118826
Fixes #1161 PiperOrigin-RevId: 397118826
Fixes #1161 PiperOrigin-RevId: 397118826
İ was facing this issue a couple weeks in crashlytics. After a lot of researching i found a solution like this; @Override
protected void onStop() {
super.onStop();
Glide.with(this).onStop();
} After adding |
I have an S23 and get the same error when trying to download too many files at once. It happens when I attempt to use NativeAdapter from dio, which uses cronet. No luck so far figuring this one out. But if I do NOT use cronet and instead just use http, no errors. HOWEVER, downloads are not as fast as cronet. |
Glide Version: 3.6.1
Device/Android Version: Huawei RIO-L01 Android 5.1
Issue details: It seems to be caused by an issue in the Android framework that occurs only on Huawei RIO-L01. Anyway it could be solved catching the exception when
DefaultConnectivityMonitor
registers the receiver.Actually I was considering to fix it myself providing a no-op
ConnectivityMonitor
only for the devices affected by this issue throughGlideBuilder#setConnectivityMonitorFactory
, but I have seen that this isn't possible in 3.x version.Stack trace / LogCat:
The text was updated successfully, but these errors were encountered: