2016-03-01 21 views
0

我在我的应用程序中使用了2个库,它们有一些常见的jar文件。 因此,当我试图编译我的应用程序时,我得到了重复条目异常。我试图排除这些jar在build.gradle该特定的库项目。 我写的代码是Android - 如何在我们的应用程序中排除库的jar文件?

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'} 

谁能给我解决?在此先感谢

+0

你想删除那些jar文件 –

+0

确保重复库是相同的版本。 –

+0

只需使用相同的版本,或使用maven依赖项更改jar –

回答

0

在'打开模块设置'选项,然后单击项目模块,单击依赖项选项卡。

不包括您添加的两个jar文件。 (不要从项目中删除,仅仅排除,如有必要,可以随时包括)

相关问题