Summary
After upgrading intercom_flutter from 9.6.5 to 9.6.6, we started seeing Android ANRs in Crashlytics during Intercom push notification handling.
The intercom_flutter upgrade appears to be the initial trigger because 9.6.6 bumps the native Intercom Android SDK:
intercom_flutter 9.6.5 uses Intercom Android SDK 18.0.3
intercom_flutter 9.6.6 uses Intercom Android SDK 18.1.0
ANR stack
main (timed waiting)
at kotlinx.coroutines.BuildersKt.runBlocking
at io.intercom.android.sdk.m5.push.IntercomPushBitmapUtilsKt.loadBitmaps(IntercomPushBitmapUtils.kt:57)
at io.intercom.android.sdk.m5.push.IntercomNotificationHandler.processConversationPushNotification(...)
at io.intercom.android.sdk.m5.push.IntercomPushClientHandler.handlePush(...)
at io.intercom.android.sdk.push.IntercomPushClient.handlePush(...)
at io.maido.intercom.PushInterceptReceiver.onReceive(PushInterceptReceiver.kt:27)
at android.app.ActivityThread.handleReceiver(...)
Notes
The intercom_flutter PushInterceptReceiver code appears unchanged between 9.6.5 and 9.6.6; it still calls:
intercomPushClient.handlePush(application, message)
from BroadcastReceiver.onReceive.
I compared the compiled Intercom Android AARs and found that IntercomPushBitmapUtilsKt.loadBitmaps changed behavior between Intercom Android SDK 18.0.3 and 18.1.0:
- In
18.0.3, loadBitmaps used coroutine launch, scheduling bitmap loading asynchronously.
- In
18.1.0, loadBitmaps calls runBlocking(Dispatchers.IO, ...), which blocks the receiver/main thread while loading notification bitmaps.
This seems likely related to the Intercom Android 18.1.0 release note: “Fixed push notification images not loading on some devices.”
Possible cause
It looks like the 18.1.0 native SDK change may have introduced a blocking path during FCM broadcast receiver handling. Since intercom_flutter handles Intercom pushes via PushInterceptReceiver.onReceive, this can block the Android main thread long enough to cause ANRs when notification image loading is slow.
Summary
After upgrading
intercom_flutterfrom9.6.5to9.6.6, we started seeing Android ANRs in Crashlytics during Intercom push notification handling.The
intercom_flutterupgrade appears to be the initial trigger because9.6.6bumps the native Intercom Android SDK:intercom_flutter 9.6.5uses Intercom Android SDK18.0.3intercom_flutter 9.6.6uses Intercom Android SDK18.1.0ANR stack
Notes
The
intercom_flutterPushInterceptReceivercode appears unchanged between9.6.5and9.6.6; it still calls:from
BroadcastReceiver.onReceive.I compared the compiled Intercom Android AARs and found that
IntercomPushBitmapUtilsKt.loadBitmapschanged behavior between Intercom Android SDK18.0.3and18.1.0:18.0.3,loadBitmapsused coroutinelaunch, scheduling bitmap loading asynchronously.18.1.0,loadBitmapscallsrunBlocking(Dispatchers.IO, ...), which blocks the receiver/main thread while loading notification bitmaps.This seems likely related to the Intercom Android
18.1.0release note: “Fixed push notification images not loading on some devices.”Possible cause
It looks like the
18.1.0native SDK change may have introduced a blocking path during FCM broadcast receiver handling. Sinceintercom_flutterhandles Intercom pushes viaPushInterceptReceiver.onReceive, this can block the Android main thread long enough to cause ANRs when notification image loading is slow.