androidstudio 编译报这个异常:program type already present: android dagger.shaded.auto.common.Visibility
这个问题是因为依赖的两个库,都拥有同一个类Visibility.class导致。
我这里依赖了
com.google.dagger?2.14.1
com.google.dagger:dagger-compiler:2.14.1
com.google.dagger这个Group中包括了dagger-compiler和dagger-spi这两个Module
这里依赖需要加上下面的配置去掉重复依赖
implementation (rootProject.ext.dependencies[“dagger2-apt”]) {
exclude group: ‘com.google.dagger’, module: ‘dagger-spi’
}
本文详细解析了在AndroidStudio中遇到的重复依赖问题,特别是关于com.google.dagger和Visibility.class冲突的情况。提供了具体的解决方案,包括如何配置排除重复依赖,确保项目的顺利编译。
1147

被折叠的 条评论
为什么被折叠?



