Reputation: 13
I want to use Stetho debuged my Andorid App,but Stetho has conflict with FastJson.
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/LICENSE.txt File1: E:\lightnote\app\src\main\libs\fastjson-1.2.8.jar File2: D:\gradle\caches\modules-2\files-2.1\commons-cli\commons-cli\1.2\2bf96b7aa8b611c177d329452af1dc933e14501c\commons-cli-1.2.jar
this is my build.gradle file content
dependencies {
compile fileTree(dir: 'src/main/libs', include: '*.jar')
compile 'com.android.support:appcompat-v7:23.0.0'
compile 'com.android.support:design:23.2.0'
compile 'com.android.support:recyclerview-v7:+'
compile 'io.reactivex:rxandroid:1.1.0'
compile 'io.reactivex:rxjava:1.1.0'
compile 'com.squareup.retrofit2:retrofit:2.0.0-beta4'
compile 'com.squareup.okhttp3:okhttp:3.2.0'
compile 'org.xutils:xutils:3.3.20'
compile 'com.jakewharton:butterknife:7.0.1'
compile 'de.greenrobot:greendao:2.1.0'
compile 'com.facebook.stetho:stetho:1.3.1'}
Sit wait
Upvotes: 0
Views: 113
Reputation: 2193
The fix is here: https://github.com/facebook/stetho/issues/141#issuecomment-90538067
Add this to your build.gradle:
android {
packagingOptions {
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
}
}
Upvotes: 0