简体   繁体   English

Android-如何在我们的应用程序中排除Library的jar文件?

[英]Android - how to exclude jar files of Library in our application?

I am using 2 libraries in my application,which are having some common jar files. 我在应用程序中使用2个库,它们具有一些常见的jar文件。 So when i am trying to compile my application i am getting duplicate entry exception.I tried to exclude those jars in build.gradle for that perticular library project . 因此,当我尝试编译我的应用程序时,我得到重复的条目exception.I试图排除build.gradle中的那个罐子为该垂直库项目。 The code i wrote is 我写的代码是

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
compile 'com.android.support:multidex:1.0.1'
compile 'com.facebook.android:facebook-android-sdk:4.5.0'
compile 'com.android.support:recyclerview-v7:23.1.1'
compile 'com.android.support:cardview-v7:23.1.1'
compile 'com.google.android.gms:play-services:8.3.0'
compile(project(':JIRAConnect')) {
    exclude module: 'org.apache.httpcomponents:httpcore'
    exclude module: 'org.apache.httpcomponents:httpclient'
    exclude group: 'com.nostra13', module: 'universalimageloader'
}
compile (project(':..:GlobalLib:MyGlobalLib')){
    exclude module: 'org.apache.httpcomponents:httpcore'
    exclude module: 'org.apache.httpcomponents:httpclient'}

Can anyone give me the solution? 谁能给我解决方案? Thanks in advance 提前致谢

In the 'open Module Settings' option and then click on the item MODULES, click the Dependencies tab. 在“打开模块设置”选项中,然后单击“模块”项,单击“依赖关系”选项卡。

Excluding the two jar files that you added. 不包括您添加的两个jar文件。 (Not to be removed from the project. Merely to exclude. May include back at any time if necessary.) (不要从项目中删除。仅排除在外。如有必要,可以随时包括在内。)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM