Intercom.client().displayMessenger() throws exception

Hey, I’ve changed the architecture of our app a little and now Intercom.client().displayMessenger() throws IllegalStateException. Before the architecture was Activity with ViewPager -> fragment of ViewPager and now it is Activity -> Fragment with ViewPager -> fragment of ViewPager.

I read that IllegalStateException should be thrown if there were any previous calls to getResources() or getAssets() but I’m not aware of any calls of ContextThemeWrapper.

Do you know what could cause this?

Log:
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.purascents.android.dev/io.intercom.android.sdk.activities.IntercomMessengerActivity}: java.lang.IllegalStateException: getResources() has already been called
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2444)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2504)
at android.app.ActivityThread.access$900(ActivityThread.java:165)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1368)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:150)
at android.app.ActivityThread.main(ActivityThread.java:5546)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:794)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:684)
Caused by: java.lang.IllegalStateException: getResources() has already been called
at android.view.ContextThemeWrapper.applyOverrideConfiguration(ContextThemeWrapper.java:67)
at io.intercom.android.sdk.utilities.ContextLocaliser.applyOverrideConfiguration(ContextLocaliser.java:70)
at io.intercom.android.sdk.activities.IntercomBaseActivity.attachBaseContext(IntercomBaseActivity.java:13)
at android.app.Activity.attach(Activity.java:6303)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2375)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2504)
at android.app.ActivityThread.access$900(ActivityThread.java:165)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1368)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:150)
at android.app.ActivityThread.main(ActivityThread.java:5546)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:794)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:684)

It’s definitely not related to that architecture. I’ve tried to launch the messenger from the splash activity and it’s throwing the same exception. Maybe something in build.script or manifest?

Aah, I must be blind. It was this issue Intercom Android SDK crashing with Android AppCompat 1.1.0-alpha03

Sry.

@rduriancik i also got the same issue, i tried to roll back my appcompat version but still i got the same issue.

implementation ‘androidx.appcompat:appcompat:1.0.2’

maybe you can help me. Thankyou! :slight_smile:

Are you sure you don’t override that version somewhere else or one of your dependencies?

1 Like

i forgot to change the dependencies in another module. Thankyou! wooo :slight_smile:

1 Like