-
Notifications
You must be signed in to change notification settings - Fork 615
Too much ANR of com.google.firebase.iid.FirebaseInstanceIdReceiver #3052
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
I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight. |
Hi @AdnanBhatti143 thanks for reporting. This is definitely very strange. First things first, can you try out the latest version and see if you get the same behavior? If the issue persists, can you provide some more details about how and when you're hitting this error? Having a small repro app would be very helpful here. Thanks |
@aguatno we upgraded to admob version 20.4.0 and firebase version 28.4.2. and google services version 4.3.10 hope for the best |
I faced the same problem, tested different libraries for a month. All firebase libraries half a year old work without ANR, but all the latest versions (in particular, performance) produce a lot of ANR |
Hey @AdnanBhatti143. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically. If you have more information that will help us get to the bottom of this, just add a comment! |
I got this issues too. I have updated Firebase(BOM) to version 28.4.2 & Admob to version 20.4.0. Still got huge amount of ARN. Before upgrade to Firebase BOM, I'm using following Firebase library (with out any ARN).
Then I changed to (lot of ARN).
|
@daront Weren't you getting any ANRs with firebase-messaging version 20.1.5 as you have mentioned above? I'm facing similar problem here with a ton of ANR's in play console. My firebase-messaging version is 20.1.0. |
@codingmonk21 Let me give more info. When I used firebase-messaging version 20.1.5 with other out-date Firebase library versions below. I got very few ANR.
After I upgrade Firebase & related gms to below versions. I got ton of ANR.
I then tried to solve the problem by updating firebase-bom to the latest version (28.4.2) like below. I still got ton of ANR.
Then, I tried again by not using BOM & downgrading only firebase-messaging back to 20.1.5 (but use latest version for other Firebase library). Still got ton of ANR.
|
While this is happening in FirebaseInstanceIdReceiver, the stack trace is during some Ads initialization code, so I'm not sure this is caused by Firebase Messaging. I'm not familiar with the Ads library, but it looks like it's doing something with a WebView, which may cause problems as it is happening while your app is handling a broadcast and generally apps shouldn't be doing UI like that from a broadcast. From your experiments with library versions, it seems as though this may be due to the version of the Ads library, so you could trying using an older version of that. Another thing you may consider is not initializing ads when handling broadcasts. |
Guys, I finally found the root cause of this error!! If MobileAds.initialize() take too long to complete(especially in slow devices), ANR will happen, while the app is actually in the background! Official document from Admobs says Don't trust them. |
Thanks alot
…On Wed, 27 Oct 2021, 16:33 daront, ***@***.***> wrote:
Guys, I finally found the root cause of this error!!
It's because MobileAds.initialize() is in MyApplication's onCreate().
When push notification is receive, FirebaseMessagingService class will be
called -> MyApplication will also created. -> MobileAds.initialize() is
then executed on the main thread.
If MobileAds.initialize() take too long to complete(especially in slow
devices), ANR will happen, while the app is actually in the background!
Official document from Admobs says
<https://developers.google.com/admob/android/quick-start>
Before loading ads, have your app initialize the Mobile Ads SDK by calling
MobileAds.initialize() which initializes the SDK and calls back a
completion listener once initialization is complete (or after a 30-second
timeout). This needs to be done only once, ideally at app launch.
Don't trust them.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#3052 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEEQBWEZZN6GVXUWGKXJTLTUI7PSHANCNFSM5F4WQAFA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
How to handle this issue? Actually i have requirement Admob for next landing activity so initialize is necessary to do |
That's great @daront, thanks for sharing the root cause. Hi @superdiazzz, as verified by daront, it would be best to initialize your MobileAds in your MainActivity's onCreate instead, you can check out this link on how to get started. I’ll be closing this for now since this has been resolved. |
Does this issue solved? I Used the FirebaseMessagingService (search nothing about FirebaseInstanceIdReceiver ) and fireBase auth 。 |
Uh oh!
There was an error while loading. Please reload this page.
[REQUIRED] Step 2: Describe your environment
[REQUIRED] Step 3: Describe the problem
the issue is produced in production and having two ANR from playstore console dont know they are related or not. i am using play services ad version 19.8.0. and firebase messaging for topic messaging
Steps to reproduce:
What happened? How can we make the problem occur?
This could be a description, log/console output, etc.
Relevant Code:
The text was updated successfully, but these errors were encountered: