2016-03-01 20 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文件。 (不要從項目中刪除,僅僅排除,如有必要,可以隨時包括)

相關問題