嗨添加Apache poi gradle構建後,我得到這個預期。你能否向我解釋一下如何解決這個問題。Android的gradle構建給DuplicateFileException
我已經試過在很多方面不包括封裝選項,沒有工作
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.1.0'
testCompile 'junit:junit:4.12'
compile 'com.android.support:design:25.1.0'
compile 'com.android.support:cardview-v7:25.1.0'
compile 'org.greenrobot:greendao:3.2.0'
compile group: 'org.apache.poi', name: 'poi-ooxml', version: '3.9'
}
錯誤:執行失敗的任務「:應用程序:transformResourcesWithMergeJavaResForDebug」。
com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK META-INF/LICENSE File1: /home/surendra/.gradle/caches/modules-2/files-2.1/org.apache.poi/poi-ooxml-schemas/3.9/4c514498f0e82cccfdd3208b9caff2f45158db4a/poi-ooxml-schemas-3.9.jar File2: /home/surendra/.gradle/caches/modules-2/files-2.1/org.apache.poi/poi-ooxml/3.9/bbe83c739d22eecfacd06d7e0b99ba13277040ed/poi-ooxml-3.9.jar File3: /home/surendra/.gradle/caches/modules-2/files-2.1/org.apache.poi/poi/3.9/5d5e41354e88322e4bc590b31f3d2d1d52b3e6ac/poi-3.9.jar
也許問題是通過替換com.github.dextorer來解決的:沙發:1.0.0而不是編譯組:'org.apache.poi',名稱:'poi-ooxml',版本:'3.9' –