android - Duplicate files copied in APK junit/runner/smalllogo.gif -
i`m using android-studio 2.2.2 , did first try using espresso testing. attached build.gradle got these error-message:
error:execution failed task ':app:transformresourceswithmergejavaresfordebugandroidtest'. > com.android.build.api.transform.transformexception: com.android.builder.packaging.duplicatefileexception: duplicate files copied in apk junit/runner/smalllogo.gif file1: /home/christian/androidstudioprojects/pinmoney/app/libs/junit-4.12.jar file2: /home/christian/.gradle/caches/modules-2/files-2.1/junit/junit/4.12/2973d150c0dc1fefe998f834810d68f278ea58ec/junit-4.12.jar here app gradle:
apply plugin: 'com.android.application' apply plugin: 'com.neenbedankt.android-apt' def aaversion = '4.1.0' android { compilesdkversion 25 buildtoolsversion "25" defaultconfig { applicationid "de.cokuss.chhe.pinmoney" minsdkversion 16 targetsdkversion 24 versioncode 1 versionname "1.0" testinstrumentationrunner "android.support.test.runner.androidjunitrunner" } buildtypes { release { minifyenabled false proguardfiles getdefaultproguardfile('proguard-android.txt'), 'proguard-rules.pro' } } packagingoptions { exclude 'licence.txt' } } dependencies { compile filetree(include: ['*.jar'], dir: 'libs') androidtestcompile files('libs/junit-4.12.jar') compile 'com.android.support:appcompat-v7:25.0.0' compile 'com.android.support:design:25.0.0' apt "org.androidannotations:androidannotations:$aaversion" compile "org.androidannotations:androidannotations-api:$aaversion" androidtestcompile ('com.android.support.test.espresso:espresso-core:2.2.2') { exclude group: 'com.android.support' } androidtestcompile ('com.android.support.test:runner:0.5') { exclude group: 'com.android.support' } } i have found several "duplicate files copied" problems while searching different files. adding
packagingoptions { exclude 'licence.txt' exclude 'smalllogo.gif' //added } does not help.
this:
packagingoptions { exclude 'licence.txt' exclude 'smalllogo.gif' //added } was not right solution, little internet found out had make more exact. found out smalllogo.gif not thing had exclude. here important part had change:
packagingoptions { exclude 'licence.txt' // old code exclude 'junit/runner/smalllogo.gif' exclude 'junit/runner/logo.gif' exclude 'license-junit.txt' } i don`t think best way fix problem, works.
Comments
Post a Comment