Android SDK & android.support.constraint.ConstraintLayout

We have an Appcelerator/Titanium app that we have been shipping with Intercom embedded in it for a few years. We were on an older version of your SDK and now it is time to upgrade.

We are using 5.1.5 of the Android SDK because it is the last on 27.1.1 support tools. We use a Titanium SDK of 7.5.0.GA which includes 27.1.1.

When I tried to build the Titanium module, I had to manually include the following dependencies which are not listed in your dependency chart in order to compile:

  • flexbox-1.0.0.aar
  • contraint-layout-1.0.2.aar

Once I had those, all the resources were found and I can build the module. We are able to build our overall app just fine as well.

However, when we try to present the messenger the app crashes. The stack trace is below.

Any ideas on the 2 dependencies that I had to add that you don’t list? Or ideas on your use of ConstraintLayout?

We are struggling on this one.

[ERROR] : TiExceptionHandler: (main) [35655,40992] Unable to start activity ComponentInfo{com.ourcompany.app/io.intercom.android.sdk.activities.IntercomMessengerActivity}: android.view.InflateException: Binary XML file line #2: Binary XML file line #2: Error inflating class android.support.constraint.ConstraintLayout
[ERROR] : TiExceptionHandler:
[ERROR] : TiExceptionHandler: android.view.LayoutInflater.inflate(LayoutInflater.java:539)
[ERROR] : TiExceptionHandler: android.view.LayoutInflater.inflate(LayoutInflater.java:423)
[ERROR] : TiExceptionHandler: io.intercom.android.sdk.homescreen.HomeFragment.onCreateView(HomeFragment.java:120)
[ERROR] : TiExceptionHandler: android.support.v4.app.Fragment.performCreateView(Fragment.java:2346)
[ERROR] : TiExceptionHandler: android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1428)
[ERROR] : TiExceptionHandler: android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1759)
[ERROR] : TiExceptionHandler: android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1827)
[ERROR] : TiExceptionHandler: android.support.v4.app.BackStackRecord.executeOps(BackStackRecord.java:797)
[ERROR] : TiExceptionHandler: android.support.v4.app.FragmentManagerImpl.executeOps(FragmentManager.java:2596)
[ERROR] : TiExceptionHandler: android.support.v4.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2383)
[ERROR] : TiExceptionHandler: android.support.v4.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManager.java:2338)
[ERROR] : TiExceptionHandler: android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:2245)
[ERROR] : TiExceptionHandler: android.support.v4.app.FragmentManagerImpl.dispatchStateChange(FragmentManager.java:3248)
[ERROR] : TiExceptionHandler: android.support.v4.app.FragmentManagerImpl.dispatchActivityCreated(FragmentManager.java:3200)
[ERROR] : TiExceptionHandler: android.support.v4.app.FragmentController.dispatchActivityCreated(FragmentController.java:195)
[ERROR] : TiExceptionHandler: android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:597)
[ERROR] : TiExceptionHandler: android.support.v7.app.AppCompatActivity.onStart(AppCompatActivity.java:177)
[ERROR] : TiExceptionHandler: android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1260)
[ERROR] : TiExceptionHandler: android.app.Activity.performStart(Activity.java:6276)
[ERROR] : TiExceptionHandler: android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2392)
[ERROR] : TiExceptionHandler: android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2493)
[ERROR] : TiExceptionHandler: android.app.ActivityThread.-wrap11(ActivityThread.java)
[ERROR] : TiExceptionHandler: android.app.ActivityThread$H.handleMessage(ActivityThread.java:1357)
[ERROR] : TiExceptionHandler: android.os.Handler.dispatchMessage(Handler.java:102)
[ERROR] : TiExceptionHandler: android.os.Looper.loop(Looper.java:148)
[ERROR] : TiExceptionHandler: android.app.ActivityThread.main(ActivityThread.java:5459)
[ERROR] : TiExceptionHandler: java.lang.reflect.Method.invoke(Native Method)
[ERROR] : TiExceptionHandler: com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728)
[ERROR] : TiExceptionHandler: com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)

We just tried your version 5.3.0 and it gave the same error FWIW.

Hey Brandon :wave:

We use both Flexbox and ConstraintLayout in our SDK. I’m not exactly sure why you needed to add them separately here though. It may have something to do with the way in which Titanium packages dependencies.

Can you please share your app level build.gradle file? I’ll check this out for you :+1:

Cheers,
Matthew

Titanium doesn’t include them so I had to pull them in.

We just solved the issue though. We found out we needed a ConstraintLayout dependency as well.

https://mvnrepository.com/artifact/com.android.support.constraint/constraint-layout-solver/1.1.3

Now things are loading in Titanium once again.

Ah great, glad to hear you got it sorted Brandon :raised_hands: Let us know if you run into any further issues with Titanium or if anything else comes up, cheers :+1: