ClassNotFoundException “android.support.v4.graphics.drawable.DrawableWrapper”

前端 未结 8 1483
温柔的废话
温柔的废话 2020-12-20 19:10

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

Caused by: java.lang.ClassNotFoundException: Didn\'t find class 
\"and         


        
相关标签:
8条回答
  • 2020-12-20 19:38

    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.

    0 讨论(0)
  • 2020-12-20 19:42

    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'
    
    0 讨论(0)
  • 2020-12-20 19:43

    Try:

    enable D8

    if you using

    AS 3.1

    0 讨论(0)
  • 2020-12-20 19:48

    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.

    0 讨论(0)
  • 2020-12-20 19:50

    Try this:

    import android.support.v7.graphics.drawable.DrawableWrapper;
    
    0 讨论(0)
  • 2020-12-20 19:52

    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.

    0 讨论(0)
提交回复
热议问题