1

If i update my dependencies from 23.1.1 to 23.2.0 CollapsingToolbarLayout is not working. App is crashing and throws error.

java.lang.RuntimeException:android.view.InflateException: Binary XML file line #77: Binary XML file line #77: Error inflating class android.support.design.widget.CollapsingToolbarLayout
                                                                                    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3319)
                                                                                      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3415)
                                                                                      at android.app.ActivityThread.access$1100(ActivityThread.java:229)
                                                                                      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1821)
                                                                                      at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                                      at android.os.Looper.loop(Looper.java:148)
                                                                                      at android.app.ActivityThread.main(ActivityThread.java:7331)
                                                                                      at java.lang.reflect.Method.invoke(Native Method)
                                                                                      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
                                                                                      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
                                                                                   Caused by: android.view.InflateException: Binary XML file line #77: Binary XML file line #77: Error inflating class android.support.design.widget.CollapsingToolbarLayout
                                                                                      at android.view.LayoutInflater.inflate(LayoutInflater.java:551)
                                                                                      at android.view.LayoutInflater.inflate(LayoutInflater.java:429)
                                                                                      at android.view.LayoutInflater.inflate(LayoutInflater.java:380)
 Caused by: java.lang.NoSuchMethodError: No static method setLayoutDirection(Landroid/graphics/drawable/Drawable;I)V in class Landroid/support/v4/graphics/drawable/DrawableCompat; or its super classes (declaration of 'android.support.v4.graphics.drawable.DrawableCompat' appears in /data/app/in.passionconnect.application-1/base.apk)

dependencies look like this

compile 'com.android.support:appcompat-v7:23.2.0'
compile 'com.android.support:design:23.2.0'
compile 'com.android.support:cardview-v7:23.2.0'
compile 'com.android.support:recyclerview-v7:23.2.0'
compile 'com.android.support:support-v4:23.2.0'

and my compileSdkVersion 23 buildToolsVersion "23.0.2"

Make it Simple
  • 1,832
  • 5
  • 32
  • 57

2 Answers2

1

Try updating the dependencies com.android.support.*** to the latest version. This may help.

mohitum
  • 936
  • 2
  • 12
  • 26
  • ya i know if i update to latest means sure it will work. But i need to update complierSDKversion also to latest. In playstore pervious apk, the compileSdkVersion 23 buildToolsVersion "23.0.2" it will affect if i update means.. – Make it Simple Nov 08 '16 at 07:40
  • Updating dependencies worked for me. I don't think updating compilarSDKVersion will affect previous play store apk. You should atleast give it a shot. – mohitum Nov 08 '16 at 07:48
1

You can try with Stable 24.2.0'

Step 1

compileSdkVersion 24
buildToolsVersion "24.0.2"

Step 2

 targetSdkVersion 24

And Then

Step 3

 compile 'com.android.support:appcompat-v7:24.2.0'
 compile 'com.android.support:design:24.2.0'

Finally Clean-Rebuild-Gradle & Run .

IntelliJ Amiya
  • 74,896
  • 15
  • 165
  • 198
  • 1
    ya i know if i update to latest means sure it will work and already i tried its worked fine. But i need to update complierSDKversion also to latest. In playstore pervious apk, the compileSdkVersion 23 buildToolsVersion "23.0.2" it will affect if i update means.. – Make it Simple Nov 08 '16 at 07:41
  • if i update to latest, it will affect in playstore while updating the apk. because in pervious apk compileSdkVersion 23 buildToolsVersion "23.0.2" is there – Make it Simple Nov 08 '16 at 07:43
  • 1
    `it will affect in playstore while updating the apk` . No problem . You can use this .Just increase `VersionCode and VersionName` – IntelliJ Amiya Nov 08 '16 at 08:05