intercom_flutter icon indicating copy to clipboard operation
intercom_flutter copied to clipboard

[9.4.3]Android crash :When app receives a notification. Unable to instantiate receiver io.maido.intercom.PushInterceptReceive

Open fenngzui opened this issue 5 months ago • 16 comments

java.lang.RuntimeException: Unable to instantiate receiver io.maido.intercom.PushInterceptReceiver: java.lang.ClassNotFoundException: Didn't find class "io.maido.intercom.PushInterceptReceiver".. Caused by: java.lang.ClassNotFoundException: Didn't find class "io.maido.intercom.PushInterceptReceiver"

fenngzui avatar Aug 04 '25 05:08 fenngzui

Flutter version 3.32.7 firebase_messaging: ^15.2.4

fenngzui avatar Aug 04 '25 05:08 fenngzui

Our app has a lot of notifications for our own business, which originally had nothing to do with intercom. However, after I updated the intercom SDK, when I received the app's own notifications on the Android app (eg: someone follow me notification), the system crashed here.: @deepak786
java.lang.RuntimeException: Unable to instantiate receiver io.maido.intercom.PushInterceptReceiver: java.lang.ClassNotFoundException: Didn't find class "io.maido.intercom.PushInterceptReceiver".

How to fix this.

fenngzui avatar Aug 08 '25 04:08 fenngzui

@fenngzui Not sure what is the issue. Could you please share your AndroidManifest file?

deepak786 avatar Aug 08 '25 05:08 deepak786

After upgrading the Intercom SDK, the same issue occurred, there is no declaration of PushInterceptReceiver in AndroidManifest. Could this be related to the obfuscation rules in proguard-rules.pro?

Ganzkiller avatar Aug 10 '25 14:08 Ganzkiller

I believe it is because of the Obfuscation. See https://stackoverflow.com/q/50392706

Are you using any Proguard rules at the moment? Please share.

deepak786 avatar Aug 11 '25 14:08 deepak786

I tested with the following Progaurd rules and its working fine.

-keepattributes SourceFile,LineNumberTable # Keep file names and line numbers.
-renamesourcefileattribute SourceFile
-keep public class * extends java.lang.Exception  # Optional: Keep custom exceptions.

The above rules are saved under file proguard-rules.pro. And this is how they are applied in Gradle file

proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'

deepak786 avatar Aug 11 '25 18:08 deepak786

It's happening on development env where we have no obfuscation

KestasVenslauskas avatar Aug 12 '25 11:08 KestasVenslauskas

@KestasVenslauskas Can you please share the MVP of the issue? So that I can check if something is wrong in Gradle configuration, etc.

deepak786 avatar Aug 12 '25 12:08 deepak786

Can anyone please tell me up to which intercom_flutter version this is working fine?

Note: in intercom_flutter: 9.3.2, firebase_messaging dependency version was updated from 23.3.1 to 24.1.1. See https://github.com/v3rm0n/intercom_flutter/pull/534

deepak786 avatar Aug 12 '25 12:08 deepak786

@deepak786 I reverted back to 9.3.1 where the last time it was working normally, but looks like right now it crashes the in the same way. Maybe the underlying SDK is broken?

KestasVenslauskas avatar Aug 12 '25 13:08 KestasVenslauskas

Did you try the flutter clean?. Because maybe it is still using the updated version.

deepak786 avatar Aug 12 '25 15:08 deepak786

@deepak786 Flutter clean helped to make it work with 9.3.1 will try newer versions

KestasVenslauskas avatar Aug 12 '25 15:08 KestasVenslauskas

@deepak786 Looks like intercom_flutter: 9.4.4 works after flutter clean

KestasVenslauskas avatar Aug 12 '25 15:08 KestasVenslauskas

@deepak786 Looks like intercom_flutter: 9.4.4 works after flutter clean

Based on this, I suggest everyone to try the flutter clean.

deepak786 avatar Aug 12 '25 16:08 deepak786

@deepak786 will this resolve Android crash related to java.lang.IllegalStateException also?

Nandhini-GA avatar Aug 18 '25 06:08 Nandhini-GA

intercom_flutter: 9.4.x all crashed when app received notification. Instabug Caught an Unhandled Exception: java.lang.RuntimeException E/IBG-Core(10297): java.lang.RuntimeException: Unable to instantiate receiver io.maido.intercom.PushInterceptReceiver: java.lang.ClassNotFoundException: Didn't find class "io.maido.intercom.PushInterceptReceiver" on path

E/IBG-Core(10297): at android.app.ActivityThread.handleReceiver(ActivityThread.java:4693) E/IBG-Core(10297): at android.app.ActivityThread.-$$Nest$mhandleReceiver(Unknown Source:0) E/IBG-Core(10297): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2399) E/IBG-Core(10297): at android.os.Handler.dispatchMessage(Handler.java:107) E/IBG-Core(10297): at android.os.Looper.loopOnce(Looper.java:232) E/IBG-Core(10297): at android.os.Looper.loop(Looper.java:317) E/IBG-Core(10297): at android.app.ActivityThread.main(ActivityThread.java:8592) E/IBG-Core(10297): at java.lang.reflect.Method.invoke(Native Method) E/IBG-Core(10297): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:580) E/IBG-Core(10297): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:878) E/IBG-Core(10297): Caused by: java.lang.ClassNotFoundException: Didn't find class "io.maido.intercom.PushInterceptReceiver" on path: DexPathList[[zip file "/data/app/~~G0yuzNVNUQZT4kynHUWZ5Q==/

E/IBG-Core(10297): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:259) E/IBG-Core(10297): at java.lang.ClassLoader.loadClass(ClassLoader.java:637) E/IBG-Core(10297): at java.lang.ClassLoader.loadClass(ClassLoader.java:573) E/IBG-Core(10297): at android.app.AppComponentFactory.instantiateReceiver(AppComponentFactory.java:110) E/IBG-Core(10297): at androidx.core.app.CoreComponentFactory.instantiateReceiver(CoreComponentFactory.java:59) E/IBG-Core(10297): at android.app.ActivityThread.handleReceiver(ActivityThread.java:4686) @deepak786

fenngzui avatar Aug 27 '25 14:08 fenngzui