Android(安卓)Program type already present: XXXX
16lz
2021-01-25
Error : Program type already present: XXXX
Android 开发中经常会遇到 AS 报这个类型的错误,不要慌,这个错误的意思是:你的项目里面存在重复依赖的问题。举个例子:
implementation 'com.github.ifmvo:Matthew_ImageLoader:1.1.3'implementation 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.43-alpha1'
假如你的项目里面添加了两个依赖,并且这两个依赖里面同时存在另外一种依赖
implementation 'androidx.appcompat:appcompat:1.0.2'
这种情况下编译就会报出 Error : Program type already present: XXXX 这个异常。
那怎么解决这个问题呢?既然是同时存在导致的冲突,那么删除掉一个不就行了么!
implementation 'com.github.ifmvo:Matthew_ImageLoader:1.1.3'implementation ('com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.43-alpha1'){ exclude group: 'com.android.support', module: 'support-annotations'}
或
implementation 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.43-alpha1'implementation ('com.github.ifmvo:Matthew_ImageLoader:1.1.3'){ exclude group: 'com.android.support', module: 'support-annotations'}
这个异常就解决了!
更多相关文章
- 没有一行代码,「2020 新冠肺炎记忆」这个项目却登上了 GitHub 中
- 不吹不黑!GitHub 上帮助人们学习编码的 12 个资源,错过血亏...
- Ubuntu中 android 安装(JDK+ECLIPSE+ANDROID)
- Android项目打包遇com.android.builder.internal.aapt.v2.Aapt2E
- 升级到3.6.3 之后,原项目出现错误 Found tag id where item is ex
- [Android]错误: -source 1.7 中不支持 lambda 表达式 (请使用 -s
- 【报错问题】 - React native Android(安卓)Invariant Violation
- android studio错误: 常量字符串过长
- android as gradle 使用过称中 错误处理