dev*_*v90 2 performance android android-layout android-fragments android-gradle-plugin
我在Gradle上收到重复的库错误,aar我在项目中添加的文件之一是http-client-library库附带的。
现在,我需要从该SDK library文件中删除该库,因为其他一些库也正在使用它。
我尝试了以下。
compile(name: 'SDK-app-1.0.0', ext: 'aar'){
exclude module: 'httpclient'
}
Run Code Online (Sandbox Code Playgroud)
但它没有影响,我仍然可以httpclient在library的子模块中看到SDK-applibrary。
我无法理解我需要在此处添加什么?是模块还是库,还是应该设置transitive=true为从aar文件中删除该库?
当我尝试在我的项目中添加此库时
重复的zip条目[android-async-http-1.4.9.jar:com / loopj / android / http / AsyncHttpClient $ 1.class])
compile声明解决此问题的最简单方法是获取compile通常将依赖项添加到项目中的语句。
然后,您可以将其拆开以得到group和module。像这样:
groupmodule排除依赖关系就像:
compile 'some.imaginary:library:4.8.15', {
exclude group: 'com.google.dagger', module: 'dagger'
}
Run Code Online (Sandbox Code Playgroud)
compile声明如果您没有compile陈述,事情会变得复杂一些(但不会太多)。您可以:
尝试找出module和group寻找在线工件。例如在Maven存储库搜索引擎中。如果查看Maven依赖项,则可以看到groupId代表您group的artifactId标签和代表您的标签module。
或者您可以在本地使用gradle:
Terminal在Android Studio中打开窗格:./gradlew androidDependencies