My Flutter application has reported a crash in the Google Play Console. The crash is a java.lang.RuntimeException with an underlying ClassNotFoundException, specifically because the Android runtime is unable to find the io.maido.intercom.PushInterceptReceiver class.
Crash Stack Trace (Core):
Fatal Exception: java.lang.RuntimeException:
Unable to instantiate receiver io.maido.intercom.PushInterceptReceiver: java.lang.ClassNotFoundException: Didn't find class "io.maido.intercom.PushInterceptReceiver" on path: DexPathList[...]
My Project Configuration:
-
Intercom Plugin Version:
intercom-android: 17.0.2 -
ProGuard/R8 Rules: I have already added a
keeprule for the Intercom SDK in myproguard-rules.profile:-keep class io.intercom.android.** { *; }
-keep class com.intercom.** { *; } -
Troubleshooting Steps Taken: I've checked my
AndroidManifest.xmland there is no manual declaration forPushInterceptReceiver, which I believe is automatically merged by theintercom_flutterplugin. Since the crash only occurs in release builds, I suspect it's a ProGuard/R8 issue.
My Questions:
-
Why would R8 remove the
io.maido.intercom.PushInterceptReceiverclass despite the existingkeeprules for the Intercom SDK? -
Is the package name
io.maido.intercomdifferent fromio.intercom.android? Should I add a specifickeeprule forio.maidorelated classes? -
Are there any other common reasons for
intercom_android'sBroadcastReceiverto be missing in a release build? -
What is the best practice to fix this specific issue?
