6

First my target API was 22 (Android L). Everything was worked fine until I lowered my target API to 19 for supporting Android 4.4 (Kitkat). Now I am getting this weird error. The App don´t crashes but only some normal buttons are disappearing. I am setting my layout via a XML file and via code. Error

Could not find class 'android.graphics.drawable.RippleDrawable', referenced from method android.support.v7.widget.AppCompatImageHelper.hasOverlappingRendering

Does anyone know what causes this error? How can I solve it?

My dependencies:

compile 'com.android.support:appcompat-v7:24.2.1'
compile 'com.android.support:design:24.2.1'
compile 'com.android.support:support-v4:24.2.1'
compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha9'

Update: I moved every Vector File to the new drwabale-v21 folder. Now I am getting this error.:

Android.view.InflateException: Binary XML file line #11: Error inflating class at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2184) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2233) at at

....

Unfortunately Android 4.4 doesn´t have support for vector drawables. What can I do you support vector drawables for => Android 4.4?

  • http://stackoverflow.com/a/35908070/1222099 The issue is that you need to return a Drawable instead of a RippleDrawable in getPressedColorRippleDrawable. Otherwise, on pre-lollipop devices, you will get a VerifyError. – michoprogrammer Oct 14 '16 at 10:29
  • 1
    This is a different problem because I am setting my Layout via a XML file not via Code. And my App doesn´t crash. –  Oct 14 '16 at 10:32
  • What about creating and inflating two different layouts? – michoprogrammer Oct 14 '16 at 11:52
  • 1
    As you can read [here](http://stackoverflow.com/a/37108798/1222099) did you use the support library 22.1 with DrawableCompat? – michoprogrammer Oct 14 '16 at 12:05
  • 1
    `'compile com.android.support:support-v4:24.2.1'` compile `'com.android.support:appcompat-v7:24.2.1'` –  Oct 14 '16 at 12:38
  • I found [this solution](http://stackoverflow.com/a/38814018/1222099). Tell me if it works. =) – michoprogrammer Oct 14 '16 at 13:44
  • Thank for your help @MachoProgrammer unfortunately I have a new error. –  Oct 14 '16 at 18:48

1 Answers1

2

I too had the same problem for past 2 hours. Thanks to Dominic's comment and the Android Packages Page that helped me find the below lines to solve it

implementation 'com.android.support:support-compat:26.1.0'
implementation 'com.android.support:support-core-utils:26.1.0'
implementation 'com.android.support:support-core-ui:26.1.0'
Abdul Saleem
  • 7,999
  • 4
  • 35
  • 37