java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/animation/AnimatorCompatHe

在开发过程中,有的时候引入了多个三方库.在调用的时候会出现版本对应不上的原因,需要强制版本号统一

解决办法,在app和Module: Librarybuild.gradle添加如下代码

configurations.all {
    resolutionStrategy.eachDependency { DependencyResolveDetails details ->
        def requested = details.requested
        if (requested.group == 'com.android.support') {
            if (!requested.name.startsWith("multidex")) {
                details.useVersion '25.3.0'
            }
        }
    }
}

参考: https://stackoverflow.com/questions/42987363/java-lang-noclassdeffounderror-failed-resolution-of-landroid-support-v4-animat

你可能感兴趣的:(Android)