Intercom Android SDK crashing with Android AppCompat 1.1.0-alpha03

Hi,

Android Intercom crash when IntercomBaseActivity call applyOverrideConfiguration with an
IllegalStateException(" Override configuration has already been set ");

It’s because, since AppCompat 1.1.0-alpha03, AppCompatActivity had already call applyOverrideConfiguration before IntercomBaseActivity

See the AppCompat git commit here :
https://android.googlesource.com/platform/frameworks/support/+/fdccf4b1a3c96ede7f955635858d5acba75b6f2e

3 Likes

Hey there Steve :wave:

What you’ve run into here is a known issue in Intercom at the moment. Our engineers are looking into it and are currently working on a fix.

I’ve come across this quite a lot and we’ve advised customers to try rolling back to version 1.0.2 of AppCompat.

However, I’ve also had some customers with who’ve managed to resolve this issue by updating to the latest version of AppCompat alpha. For example updating to appcompat 1.1.0-alpha05.

Thanks for your answer

AppCompat 1.1.0-alpha05 doesn’t exists yet
AppCompat 1.1.0-alpha04 had the same issue

Rolling back to version 1.0.2 of AppCompat works again

Ah right sorry, I didn’t realise alpha05 wasn’t out yet! Okay I’m glad that resolved the issue for now. I’ll reach out to you through Intercom once the issue is resolved to let you know. :+1:

1 Like

Hi our integrated intercom in android is also crashing
Error Logs :
Unable to start activity ComponentInfo{client.spanda.com/io.intercom.android.sdk.activities.IntercomMessengerActivity}: java.lang.IllegalStateException: getResources() or getAssets() has already been called

Caused by: java.lang.IllegalStateException: getResources() or getAssets() has already been called
at android.view.ContextThemeWrapper.applyOverrideConfiguration(ContextThemeWrapper.java:95)
at io.intercom.android.sdk.utilities.ContextLocaliser.applyOverrideConfiguration(ContextLocaliser.java:70)
at io.intercom.android.sdk.activities.IntercomBaseActivity.attachBaseContext(IntercomBaseActivity.java:13)

I also tried to rolling back my version but still not working.

----> implementation ‘androidx.appcompat:appcompat:1.0.2’

@steve.grosbois do you have suggestion regarding this error? Thankyou so much for the help.

Use appcompat version 1.1.0-alpha02 and then add

configurations.all {
    resolutionStrategy.eachDependency { details ->
        def requested = details.requested
        if (requested.group == 'androidx.appcompat') {
            details.useVersion '1.1.0-alpha02'
        }
    }
}

at the bottom of your app-level build.gradle.

1 Like

Update on this, the issue still happens with 1.1.0-alpha05.

Apparently this is because

getResources() or getAssets() has already been called

In this case getResources is called before the applyOverrideConfiguration in the ContextLocaliser class

Here is the stacktrace :

java.lang.RuntimeException: Unable to start activity ComponentInfo{*/io.intercom.android.sdk.activities.IntercomMessengerActivity}: java.lang.IllegalStateException: getResources() or getAssets() has already been called
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3037)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3172)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1906)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6863)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:537)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Caused by: java.lang.IllegalStateException: getResources() or getAssets() has already been called
at android.view.ContextThemeWrapper.applyOverrideConfiguration(ContextThemeWrapper.java:95)
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:7064)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2997)

1 Like

We’re also seeing the same issue.

I would urge you to make issues on your GitHub repo public - you’re missing out on a lot of potential feedback and a better way to interact with the wider developer community, as well as a way to keep us up to date with progress on bugs like this one.

5 Likes

When it will be solved? I am getting the same crash on androidx.appcompat:appcompat:1.1.0-beta01.

Didn’t work. The crash is still happening on beta 1.

Hey there,

Would it be possible for you to attempt a revert to version 1.0.2 to see if that resolves the issue? As the originally reported issues I’ve heard from customers was from the alpha versions so the beta versions might be similarly affected.

Hey there folks,

In regards to the issue of AppCompat versions crashing with the Android SDK, I’ve heard back from our engineers who are looking into this, we are going to release an updated version of the SDK in our next cycle which will fix the issues with okhttp.

We don’t have an exact ETA on when this will be implemented and the wider issues, but once we do hear back, we will let you know the plan of action

We are also affected by this crash, please fix! :slight_smile:

What a bullshit, there is an AppCompat beta01 version at the moment and you haven’t solved the problem yet. Do you even try?

This is crashing for me on intercom sdk version 5.3.2
Is there a version of the intercom sdk that doesn’t have this bug or a workaround that works?

Never mind, Mike’s answer worked for me :+1:

1 Like

Is there any update on this? It is still crashing for me in 5.3.2 with AppCompat 1.1.0-beta01. And I cannot downgrade AppCompat because that is causing some other component to crash.

This isn’t a solution to those of use that need a later version of appcompat. Considering that appcompat is a dependency for many other (Jetpack) libraries, this is going to become a pretty big deal. Appcompat has now hit 1.1.0-RC1.

1 Like

Hey @intercom! We still need a solution for this. The above answers didn’t work for me.

Still an issue here too. This is a major issue for us, and probably many others. We either need confirmation that this is being looked into, or we’ll have to begin looking for other alternatives. Not upgrading appcompat is not an option when there are so many new jetpack features and libraries that depend on this.

1 Like