2017-04-13 71 views
2

項目安裝此庫後:的Android得DuplicateFileException誤差改造和改造適配器

compile 'io.reactivex.rxjava2:rxandroid:2.0.1' 
compile 'io.reactivex.rxjava2:rxjava:2.0.1' 
compile 'com.squareup.retrofit2:adapter-rxjava:2.1.0' 

我得到這個錯誤:

Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'. 
com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK META-INF/rxjava.properties 
File1: /Users/mahdi/.gradle/caches/modules-2/files-2.1/io.reactivex.rxjava2/rxjava/2.0.1/57f850a6b317e5582f1dbaff10a9e7d7e1fcdcfb/rxjava-2.0.1.jar 
File2: /Users/mahdi/.gradle/caches/modules-2/files-2.1/io.reactivex/rxjava/1.1.5/ece7b5d0870e66d8226dab6dcf47a2b12afff061/rxjava-1.1.5.jar 

我不知道什麼問題,有些文件安裝它們喜歡我的解決方案。

packagingOptions { 
    exclude 'META-INF/io.reactivex.rxjava2/rxjava/2.0.1/57f850a6b317e5582f1dbaff10a9e7d7e1fcdcfb/rxjava.properties' 
    exclude 'META-INF/io.reactivex/rxjava/rxjava.properties' 
} 

回答

3

問題解決:

packagingOptions { 
    exclude 'META-INF/rxjava.properties' 
}