Intercom Android SDK crashing with Android AppCompat 1.1.0-alpha03

Found the issue. It’s not with AppCompat it’s with the material library (At least with my case)

Use this implementation 'com.google.android.material:material:1.0.0'

I updated to latest 5.4.0 version of Intercom. This issue is still not fixed. Can we have some definite answer on this? We have had to stop releasing updates to our App because of this issue.

3 Likes

I have updated to 5.4.0 and tried the solution proposed by @Alan_Haverty but it didn’t work. Please Intercom fix this problem. Currently Intercom is disabled on my product and we cannot help our Android users. This is a serious problem.

Any news when these non compatibilities with latest Android and Material libraries will be resolved in an Intercom Update?

Tested with Intercom-SDK “5.4.0”. I’ve setup a simple demo project and can confirm that it works with having these two dependencies:

implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'com.google.android.material:material:1.0.0'

These are the last versions working:

implementation 'androidx.appcompat:appcompat:1.1.0-alpha02'
implementation 'com.google.android.material:material:1.1.0-alpha05'

Using updated versions of either, leads to an instant crash when trying to “displayMessenger”. Tested latest versions along with anything in between.

implementation 'androidx.appcompat:appcompat:1.1.0-rc01'
implementation 'com.google.android.material:material:1.1.0-alpha08'

Crash:

java.lang.RuntimeException: Unable to start activity ... java.lang.IllegalStateException: **getResources() has already been called**
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2416)
    ...
 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)

Which sounds directly related to the change highlighted with the link by the original reporter. You mentioned that you expect the change related to “okhttp”, but doesn’t it sound more like an Activity lifecycle issue?

Configuration Change related fixes have also been added in the latest “AppCompat rc01” version. Maybe that will help solve the issues?
https://developer.android.com/jetpack/androidx/releases/appcompat#1.1.0-rc01

The mentioned trick providing the resolutionStrategy doesn’t work either with the newer versions. Reverting to the last working alpha versions worked on its own.

Unfortunately we already use some of the API changes introduced since the above last stable releases. So downgrading would lead to extra work plus potentially reintroduce bugs that have been fixed in the past half year.

1 Like

I have a solution for material 1.1.0-alpha-05
You need to use
implementation ‘com.google.android.material:material:1.1.0-alpha05’
if you have new matrial
implementation ‘com.google.android.material:material:1.1.0-alpha07-08’
and have a lot of changes in appp
change to alpha-05
create xml named attrs.xml in values
and put ther this code

resources
attr name=“itemShapeAppearance”
attr name=“itemShapeAppearanceOverlay”
resources
Closing tags you know!

that code from material design attributes xml in github
if with build app you have another mistakes with differense betwen 0.5 and 0.7
just follow the mistakes and look into the github materials xml fales

Here is the link for attrs

It works for me!

1 Like

Still facing this issue when using appcompat:1.1.0-rc01 and intercom sdk: 5.4.0

1 Like

the intercom activity can’t be opened and crashed. you should take this issue as priority and release a hot fix. Downgrade is not an option, appcompat 1.0.2 is quite old!

Thanks for your patience everyone, this crash is now resolved in release 5.4.1 of the Android SDK.

For context, the crash started to happen since androidx.appcompat-alpha03 (release notes)
and it was introduced by Google along with this change: Fixed WebView resets DayNight Resources. This change calls applyOverrideConfiguration() internally within attachBaseContext() during the activity lifecycle - since applyOverrideConfiguration() can only be called once, we were experiencing a crash when trying to set the Messenger locale to match the settings created by teammates. It’s always tricky to support libraries prior to a stable release, so we appreciate your patience while we made the necessary changes and tested to ensure no functionality was broken.

4 Likes

we are using androidx

  1. implementation ‘androidx.appcompat:appcompat:1.1.0-rc01’
  2. implementation ‘com.google.android.material:material:1.0.0’
  3. implementation ‘io.intercom.android:intercom-sdk-base:5.4.1’

still getting crash when clicking on start conversation.
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.xxx.xxxx, PID: 12266
android.view.InflateException: Binary XML file line #9: Could not inflate Behavior subclass android.support.design.widget.AppBarLayout$ScrollingViewBehavior
Caused by: java.lang.RuntimeException: Could not inflate Behavior subclass android.support.design.widget.AppBarLayout$ScrollingViewBehavior
at androidx.coordinatorlayout.widget.CoordinatorLayout.parseBehavior(CoordinatorLayout.java:632)
at androidx.coordinatorlayout.widget.CoordinatorLayout$LayoutParams.(CoordinatorLayout.java:2863)
at androidx.coordinatorlayout.widget.CoordinatorLayout.generateLayoutParams(CoordinatorLayout.java:1714)
at androidx.coordinatorlayout.widget.CoordinatorLayout.generateLayoutParams(CoordinatorLayout.java:112)

Thanks for updating us @Nicolette and special thanks to the developers for the special release addressing this issue and !

I can confirm in our project all works now as expected using the following latest versions:

io.intercom.android:intercom-sdk-base:5.4.1'
implementation 'androidx.appcompat:appcompat:1.1.0-rc01'
implementation 'com.google.android.material:material:1.1.0-alpha09'

Used the following lines to start showing the messages (in case that helps anyone)

Intercom.initialize [...]
Intercom.setLogLevel(Intercom.LogLevel.DEBUG) // for dev builds only
Intercom.client().registerIdentifiedUser [...]
Intercom.client().displayMessenger()