6

What can cause this error for class DrawableWrapper from the support lib?

Caused by: java.lang.ClassNotFoundException: Didn't find class 
"android.support.v4.graphics.drawable.DrawableWrapper" on path: 
DexPathList[[zip file "/data/app/com.example.banyan.tasty-
1/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
sunadorer
  • 3,855
  • 34
  • 42
  • What is wrong in this question? – Chandra Sekhar Mar 03 '18 at 13:00
  • @Hari Prasath Can you please add more information. Your error could be related to the support library `dependencies` inside your `build.gradle`. Could you please add the relevant part of your configuration? – sunadorer Apr 02 '18 at 18:32

8 Answers8

15

Try updating your support library to 27.1.0.

irfano
  • 196
  • 2
  • 4
4

Make sure all of your "com.android.support:*" dependencies are at the same version.

Looks like one of the support libraries uses something that is missing in the other one.

sunadorer
  • 3,855
  • 34
  • 42
Tomislav
  • 105
  • 6
4

i fixed same error updating version

implementation 'com.android.support:design:27.0.2'
implementation 'com.android.support:support-v4:27.0.2'

To

implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:support-v4:27.1.1'
Carlos Fonseca
  • 7,881
  • 1
  • 17
  • 13
Erick Amoedo
  • 475
  • 1
  • 4
  • 9
1

I started getting this exception in Android 5 and Android 4 users after removing com.android.support-v13 from my build.gradle file:

configurations.all {
    exclude group: 'com.android.support', module: 'support-v13'
}

I removed the above exclude configuration and no longer saw this crash.

gokeji
  • 132
  • 3
  • 7
0

In my case, I used support library version '27.0.2' for my project. It was working perfectly. However, when I copy & paste the project to different location and I opened in Android studio. That time, android studio added below line in build.gradle (path: MyProject/app/build.gradle)

compile 'com.android.support:support-v4:27.1.1'

Then I got the below exception.

Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v4.graphics.drawable.DrawableWrapper" on path: DexPathList

I removed the line from build.gradle (MyProject/app/build.gradle). Now it is working fine.

Thirumalvalavan
  • 2,660
  • 1
  • 30
  • 32
0

Try this:

import android.support.v7.graphics.drawable.DrawableWrapper;
Marcello B.
  • 4,177
  • 11
  • 45
  • 65
Jarvis098
  • 1,420
  • 1
  • 11
  • 16
0

import android.support.v7.graphics.drawable.DrawableWrapper;

or

import android.support.v4.graphics.drawable.WrappedDrawable; will help.

Also, when you use Drawable inner = ((WrappedDrawable) drawable).getWrappedDrawable();, you can add @SuppressLint("RestrictedApi") above your method.

CoolMind
  • 26,736
  • 15
  • 188
  • 224
-1

Try:

enable D8

if you using

AS 3.1

4b0
  • 21,981
  • 30
  • 95
  • 142
Nuclominus
  • 124
  • 3