Glide使用过程中错误集锦

java.lang.NoSuchMethodError: No static method getDrawable(Landroid/content/Context;I)Landroid/graphics/drawable/Drawable; in class Landroid/support/v7/content/ContextCompat; or its super classes (declaration of 'android.support.v7.content.ContextCompat' appears in /data/data/com.sunskym/files/instant-run/dex/slice-qssdk_dea80f4e7c3646ad9ed2d551a6c67de7e91fdebc-classes.dex)
at com.bumptech.glide.request.SingleRequest.loadDrawableV7

log是随便粘贴的,和我的基本一样,都是说的什么v7,v4包冲突之类的,第一反应就是此类错误,后来经过排查发现是glide里面加载占位图导致的错误,考虑到之前引用三方库导致的v7包的冲突,所以直接修改了gradle,统一了版本,如下

configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
def requested = details.requested
if (requested.group == 'com.android.support') {
if (!requested.name.startsWith("multidex")) {
details.useVersion '24.3.0'
}
}
}
}
猜测可能是由于useVersion版本太低导致的,于是修改了25.3.0版本,测试,bug解决

你可能感兴趣的:(Glide使用过程中错误集锦)