Skip to content

Android ANRs after intercom_flutter 9.6.6 upgrade #629

@adamkoch

Description

@adamkoch

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions