firebase-android-sdk: ANR at com.google.internal.firebase.inappmessaging.v1.sdkserving.InAppMessagingSdkServingGrpc$InAppMessagingSdkServingBlockingStub.fetchEligibleCampaigns (InAppMessagingSdkServingGrpc.java:222)

[READ] Step 1: Are you in the right place?

Issues filed here should be about bugs in the code in this repository. If you have a general question, need help debugging, or fall into some other category use one of these other channels:

  • For general technical questions, post a question on StackOverflow with the firebase tag.
  • For general Firebase discussion, use the firebase-talk google group.
  • For help troubleshooting your application that does not fall under one of the above categories, reach out to the personalized Firebase support channel.

[REQUIRED] Step 2: Describe your environment

  • Android Studio version: 3.4.1 ->3.6.1
  • Firebase Component: firebase-inappmessaging-display
  • Component version: 19.0.4

[REQUIRED] Step 3: Describe the problem

Steps to reproduce:

This is shown as an ANR report. The problem is happening only in one version after “Downgrade to SDKs that use a version of Firebase InstanceId before v20.1.0. The easiest way to do this is to depend on Firebase Messaging v20.1.0 (or before) and lock the version of Firebase InstanceId to v20.0.2 in your Gradle file.” as suggested in #1339

These were the only changes:

classpath com.android.tools.build:gradle: 3.4.1 ->3.6.1 classpath io.fabric.tools:gradle: 1.28.1 -> 1.31.2

com.google.firebase:firebase-messaging: 20.1.3 -> 20.1.0 added explicit com.google.firebase:firebase-iid:20.0.2 implementation('com.crashlytics.sdk.android:crashlytics: 2.5.2 -> 2.10.1 ') { transitive = true }

Relevant Code:

"main" prio=5 tid=1 Waiting
  | group="main" sCount=1 dsCount=0 flags=1 obj=0x74695990 self=0x6f34014c00
  | sysTid=26280 nice=-10 cgrp=default sched=0/0 handle=0x6fba84e548
  | state=S schedstat=( 65587206081 31035698087 209749 ) utm=5200 stm=1358 core=6 HZ=100
  | stack=0x7fe1ffc000-0x7fe1ffe000 stackSize=8MB
  | held mutexes=
  at java.lang.Object.wait (Object.java)
- waiting on <0x02c37e9f> (a java.lang.Object)
  at java.lang.Thread.parkFor$ (Thread.java:2137)
- locked <0x02c37e9f> (a java.lang.Object)
  at sun.misc.Unsafe.park (Unsafe.java:358)
  at java.util.concurrent.locks.LockSupport.park (LockSupport.java:190)
  at io.grpc.stub.ClientCalls$ThreadlessExecutor.waitAndDrain (ClientCalls.java:660)
  at io.grpc.stub.ClientCalls.blockingUnaryCall (ClientCalls.java:132)
  at com.google.internal.firebase.inappmessaging.v1.sdkserving.InAppMessagingSdkServingGrpc$InAppMessagingSdkServingBlockingStub.fetchEligibleCampaigns (InAppMessagingSdkServingGrpc.java:222)
  at com.google.firebase.inappmessaging.internal.GrpcClient.fetchEligibleCampaigns (GrpcClient.java:38)
  at com.google.firebase.inappmessaging.internal.ApiClient.lambda$getFiams$0 (ApiClient.java:104)
  at com.google.firebase.inappmessaging.internal.ApiClient$$Lambda$1.then (ApiClient.java:5222)
  at com.google.android.gms.tasks.zzd.run (zzd.java:5)
  at android.os.Handler.handleCallback (Handler.java:873)
  at android.os.Handler.dispatchMessage (Handler.java:99)
  at android.os.Looper.loop (Looper.java:193)
  at android.app.ActivityThread.main (ActivityThread.java:6715)
  at java.lang.reflect.Method.invoke (Method.java)
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:493)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:911)

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 6
  • Comments: 24 (12 by maintainers)

Most upvoted comments

Another quick update here. I am able to reproduce this issue using NetGuard. Fix coming soon

Hey friends, we’re going to be releasing this as a part of the official release coming tomorrow. So you should see fiam 19.0.6 available at that time. I’ll leave this open and close it when the new dependency is available and verified.

btw, reverting to 19.0.3 fixed the issue. I do not see ANR due fiam in new release

Fix merged into master, I’ll try to get a hotfix release out asap.

I’m seeing this ANR in prod starting with update for com.google.firebase:firebase-inappmessaging from 19.0.3 to 19.0.4

  at java.lang.Object.wait (Object.java)
- waiting on <0x071fb630> (a java.lang.Object)
  at java.lang.Thread.parkFor$ (Thread.java:2137)
- locked <0x071fb630> (a java.lang.Object)
  at sun.misc.Unsafe.park (Unsafe.java:358)
  at java.util.concurrent.locks.LockSupport.park (LockSupport.java:190)
  at io.grpc.stub.ClientCalls$ThreadlessExecutor.waitAndDrain (ClientCalls.java:660)
  at io.grpc.stub.ClientCalls.blockingUnaryCall (ClientCalls.java:132)
  at com.google.internal.firebase.inappmessaging.v1.sdkserving.InAppMessagingSdkServingGrpc$InAppMessagingSdkServingBlockingStub.fetchEligibleCampaigns (InAppMessagingSdkServingGrpc.java:222)
  at com.google.firebase.inappmessaging.internal.GrpcClient.fetchEligibleCampaigns (GrpcClient.java:38)
  at com.google.firebase.inappmessaging.internal.ApiClient.lambda$getFiams$0 (ApiClient.java:104)
  at com.google.firebase.inappmessaging.internal.ApiClient$$Lambda$1.then (ApiClient.java:65)
  at com.google.android.gms.tasks.zzd.run (zzd.java:5)

I get it for all my activities and for broadcast events: com.google.firebase.MESSAGING_EVENT

Alright I’m closing this issue.

Hey, sorry a couple other fires to put out. I am dedicating all day today to this so hopefully I can get the fix ready by today or tomorrow. I can release this fix as a hotpatch so it will go out as soon as I can get it working and tested. From what I can see, the only way to repro is to disable network to the app using a VPN, have you folks reproduced this any other way?