What can cause this error for class DrawableWrapper
from the support lib?
Caused by: java.lang.ClassNotFoundException: Didn\'t find class
\"and
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.
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'
Try:
enable D8
if you using
AS 3.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.
Try this:
import android.support.v7.graphics.drawable.DrawableWrapper;
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.