Skip to content

ANRs in Android #3661

Closed
Closed

Description

@deepak786

We have some ANRs in the Flutter Android app. So I posted an issue on the Flutter repo and after investigating from there, it seems that the issue is with the FirebaseMessaging from the native side.
And they suggested putting it here for more debugging.

Referenced issues:
flutter/flutter#101886
firebase/flutterfire#8467

You can check the ANRs here flutter/flutter#101886 (comment)

Activity

  1. google-oss-bot commented on Apr 19, 2022

    @google-oss-bot
    Collaborator

    I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

  2. argzdev commented on Apr 19, 2022

    @argzdev
    Contributor

    Hi @deepak786, thanks for reporting. May I ask what Firebase products and version of the SDK are you using in Flutter? Thanks

  3. deepak786 commented on Apr 19, 2022

    @deepak786
    Author

    @argzdev I'm using the below Firebase products

      firebase_core: 1.13.1
      firebase_auth: 3.3.11
      firebase_analytics: 9.1.2
      firebase_crashlytics: 2.5.3 #web support pending
      firebase_database: 9.0.8
      firebase_storage: 10.2.9
      firebase_dynamic_links: 4.1.1 #web support pending
      firebase_messaging: 11.2.11
      firebase_in_app_messaging: 0.6.0+9 #web support pending
      firebase_remote_config: 2.0.2
      cloud_firestore: 3.1.10
      cloud_functions: 3.2.10
    
  4. argzdev commented on Apr 21, 2022

    @argzdev
    Contributor

    Thanks for reporting, @deepak786. I can see Crashlytics, Auth, and Messaging in the ANR logs, but none of them shows any indication that the thread is being suspended due to the said products.

    Unfortunately, There's not much I can investigate here since the logs doesn't show which is the culprit for the ANR, and there aren't any steps to reproduce the issue or code snippets for me to pin point where the issue lies. That being said, I'll close this issue for now until further details can be provided. Feel free to ask this to be reopen once there are extra details provided or if any other developers also experience this issue.

    Perhaps some things you can look into:

    1. When did the ANR issues began happening? Was it due to a version update on which Firebase products?
    2. Is it possibly after releasing a Firebase Messaging campaign?
    3. How many % of your total user base is being affected by this issue? This could point to how rare or consistent this issue occurs.
  5. deepak786 commented on Apr 21, 2022

    @deepak786
    Author

    @argzdev this is effecting a lot of users as you can see in the screenshot from Crashlytics.
    This screenshot is for the last 90 days.

    Screen Shot 2022-04-21 at 7 50 19 PM

    See this screenshot, user just open the app and it just closes.
    Screen Shot 2022-04-21 at 7 50 59 PM

    I don't have the steps to reproduce this issue.

  6. argzdev commented on Apr 21, 2022

    @argzdev
    Contributor

    Hi @deepak786, I can see from your data that there are a lot of ANR events right after updating your app to version 3.4.1. Maybe you can investigate what changes you've made to your app (such as update of Firebase products), this might help us pin point the issue.

  7. deepak786 commented on Apr 21, 2022

    @deepak786
    Author

    There are ANRs with the 3.3.5 version as well.
    Why do we have so many ANRs starting with 3.4.1? because at that time we released the app for 100% users.
    Before that, it was only for some percentage of the users.

  8. deepak786 commented on Apr 22, 2022

    @deepak786
    Author

    @argzdev There are other issues regarding the ANRs as well
    #3052
    #3059
    firebase/quickstart-unity#1257

    I believe the ANRs are similar.

    So this must be analyzed.

  9. argzdev commented on Apr 22, 2022

    @argzdev
    Contributor

    Hi @deepak786, thanks for linking the other issues as well. I tried investigating the ANR logs you've provided, but there's no clear sign that the ANR (based on the logs) were due to the FirebaseMessaging or FirebaseInstanceIdReceiver component.

    Quoting darshankawar:

    Looking at the logs you shared, it doesn't seem to be caused by messaging plugin, but due to native Android code and probably due to FirebaseInstanceIdReceiver component.

    If you check the ANR logs, it shows the Firebase products being used, but there's no SUSPENDED, MONITOR, or "waiting to lock" within those logs. I understand you want this to be investigated, but given that there's no reliable stacktrace, or minimal repro of this issue, it is difficult to "guess" where the issue lies.

    If you can provide more evidence that the ANR issue is indeed due to a specific Firebase product, then I can probably justify an engineer’s time to dig into it with that much evidence.

    If you see something similar to ANR Broadcast of Intent { act=com.google.android.c2dm.intent.RECEIVE flg=0x10000010 | com.google.firebase.iid.FirebaseInstanceIdReceiver (has extras) }, please let us know.

  10. deepak786 commented on Apr 22, 2022

    @deepak786
    Author

    @argzdev the title of the above ANRs flutter/flutter#101886 (comment) says
    Input dispatching timed out (ActivityRecord{f096c18} does not have a focused window)

    Will this help?

    I also see this ANR Broadcast of Intent { act=com.google.android.c2dm.intent.RECEIVE flg=0x10000010 | com.google.firebase.iid.FirebaseInstanceIdReceiver (has extras) }

    But there is no stack trace info on the Play Developer console.
    Screen Shot 2022-04-22 at 11 51 04 PM
    Screen Shot 2022-04-22 at 11 51 14 PM

  11. argzdev commented on Apr 25, 2022

    @argzdev
    Contributor

    Hi @deepak786, just to confirm does this issue also have the same amount of occurrence as the previous ANR?

    From what I can tell is that, if it has an almost equal amount of occurrence with the previous ANR, then it would mean that both of these are the same issue. Else, then it means that those are two distinct issues.

  12. argzdev commented on Apr 26, 2022

    @argzdev
    Contributor

    FWIW, since we cannot verify that the issue is due to FirebaseMessaging, what I can advise is for you to try out the solutions provided in this blog, this was shared by another developer which I think will help with your issue. Thanks

  13. deepak786 commented on Apr 26, 2022

    @deepak786
    Author

    @argzdev I think the ANRs are similar to flutter/flutter#70028
    Could you please confirm if they are the same?
    If yes, then it is the issue with Flutter Framework.

  14. deepak786 commented on May 19, 2022

    @deepak786
    Author
  15. argzdev commented on May 19, 2022

    @argzdev
    Contributor

    @deepak786, it does look like the same issue. With the similarity of Android 11.0 devices experiencing the same ANR.

  16. deepak786 commented on May 19, 2022

    @deepak786
    Author

    #3661 (comment)

    90% OS is Android 11.

  17. locked and limited conversation to collaborators on May 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions