【发布时间】:2018-10-22 04:16:15
【问题描述】:
我遇到了几个库冲突问题。我通过添加解决了
配置{
all {
exclude module: 'httpclient'
exclude module: 'commons-logging'
exclude group: 'org.json', module: 'json'
exclude group: 'org.apache.httpcomponents'
exclude module: 'xmlParserAPIs'
exclude module: 'xpp3'
exclude module: 'opengl-api'
}
}
但仍然存在以下错误。而且我无法构建签名的apk。 我已经尝试过项目清理/重建选项。
错误:android 定义的类与现在由 Android 提供的类冲突。解决方案包括查找没有相同问题的较新版本或替代库(例如,对于 httpclient,请改用 HttpUrlConnection 或 okhttp),或使用 jarjar 之类的东西重新打包库。 [重复平台类]
提前感谢您的帮助。
【问题讨论】:
-
你能发布你的完整 build.gradle。
-
那么你是如何解决这个问题的?
-
在 gradlew 依赖项的帮助下,我找到了所有库,这些库正在产生冲突。因为某些库具有其他库的内部依赖性。所以我在我的 build.gradle 文件中排除了库。干净的代码之后。它有效。
标签: android android-layout android-studio gradle build.gradle