我正在尝试将 powermock-mockito 和 mockito 添加到 Android 测试项目中。我使用 android 命令行工具创建了 android 测试项目来创建 build.xml 和项目结构。我的 libs/ 目录中有以下 jars:
- dexmaker-1.0.jar
- dexmaker-mockito-1.0.jar
- mockito-all-1.9.5.jar
- powermock-mockito-1.5-full.jar
当我尝试使用 ant debug 构建项目时,出现以下错误:
[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
我不确定它是如何在单个 jar 中找到重复文件的。build.xml 文件根本没有被修改,我还没有创建 custom_rules.xml。任何帮助将不胜感激。