Program type already present: android.support.v4.app.ActionBarDrawerToggle$DelegateProvider

96
情随事迁666
2018.03.12 14:40 字数 108

//Error:Program type already present: android.support.v4.app.ActionBarDrawerToggle$DelegateProvider

java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/animation/AnimatorCompatHelper;
java.lang.NoSuchFieldError: No field notification_template_lines of type
趣拍的sdk比较奇葩了。
//不设置24.2.1但是设置到了25就找不到布局,全部不管好像又冲突设置24.2.1 那么 要么冲突 要么 版本各种各样的问题

下面的方法可以解决问题:

configurations.all {
    resolutionStrategy.eachDependency { DependencyResolveDetails details ->
        def requested = details.requested
        if (requested.group == 'com.android.support') {
            if (!requested.name.startsWith("multidex")
                    && !requested.name.startsWith("exifinterface")) {
                details.useVersion '24.2.1'
                //不设置24.2.1但是设置到了25就找不到布局,全部不管好像又冲突设置24.2.1 那么 要么冲突 要么       java.lang.NoSuchFieldError: No field notification_template_lines of type
            }
        }
    }
}
bug王
Web note ad 1