I am trying to add powermock-mockito and mockito to an Android Test project. I created an Android test project using the android command line tool to create build.xml and project structure. I have the following banks in the libs / directory:
- dexmaker-1.0.jar
- dexmaker-mockito-1.0.jar
- Mockito-all-1.9.5.jar
- powermock-mockito-1,5-full.jar
When I try to create a project using ant debug, I get the following error:
[apkbuilder] Creating ProjectTests-debug-unaligned.apk and signing it with a debug key... [apkbuilder] Found duplicate file for APK: mockito-extensions/org.mockito.plugins.MockMaker [apkbuilder] Origin 1: /home/cmiller/Projects/android-project/ProjectTests/libs/powermock-mockito-1.5-full.jar [apkbuilder] Origin 2: /home/cmiller/Projects/android-project/ProjectTests/libs/powermock-mockito-1.5-full.jar BUILD FAILED /home/cmiller/Applications/adt-bundle-linux/sdk/tools/ant/build.xml:951: The following error occurred while executing this line: /home/cmiller/Applications/adt-bundle-linux/sdk/tools/ant/build.xml:962: The following error occurred while executing this line: /home/cmiller/Applications/adt-bundle-linux/sdk/tools/ant/build.xml:319: com.android.sdklib.build.DuplicateFileException: Duplicate files at the same path inside the APK
I am not sure how to find a duplicate file in one bank. The build.xml file was not modified at all, and I did not create custom_rules.xml. Any help would be greatly appreciated.
android unit-testing mockito powermock
Jearil
source share