android studio 配置错误汇总

1,Program type already present: android.support.v4.app.BackStackRecord$Op Message{kind=ERROR, text=Program type already present: android.support.v4.app.BackStackRecord$Op, sources=[Unknown source file], tool name=Optional.of(D8)}

build 引入的包版本冲突。三种解决方法

--- 

implementation ('com.github.ViksaaSkool:AwesomeSplash:v1.0.0') {    
    exclude group: 'com.android.support'
    exclude module: 'appcompat-v7'
    exclude module: 'support-v4'
}

---

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.1'
        }
     } 

   }
}

-------

final SUPPORT_LIB_VER = '28.0.0'

configurations.all {
    resolutionStrategy {
        force "com.android.support:appcompat-v7:${SUPPORT_LIB_VER}"
        force "com.android.support:support-v4:${SUPPORT_LIB_VER}"
    }
}

2, 

发布了74 篇原创文章 · 获赞 36 · 访问量 25万+

猜你喜欢

转载自blog.csdn.net/kdsde/article/details/89513539