我正在尝试使用以下 gradle 构建文件构建 Android 测试
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.4.2'
}
apply plugin: 'android-library'
repositories {
mavenCentral()
}
dependencies {
instrumentTestCompile "junit:junit:4.+"
}
android {
compileSdkVersion 17
buildToolsVersion "17.0.0"
instrumentTest.setRoot('tests')
instrumentTest {
java.srcDirs = ['tests/src']
res.srcDirs = ['tests/res']
assets.srcDirs = ['tests/assets']
resources.srcDirs = ['tests/src']
}
}
}
运行时出现以下错误:
错误:打包 APK 期间文件重复...存档路径:LICENSE.txt 来源 1:....gradle/caches/artifacts-24/filestore/junit/junit/4.11/jar/4e031bb61df09069aeb2bffb4019e7a5034a4ee0/junit-4.11.jar来源 2: ....gradle/caches/artifacts-24/filestore/org.hamcrest/hamcrest-core/1.3/jar/42a25dc3219429f0e5d060061f71acb49bf010a0/hamcrest-core-1.3.jar :packageTest FAILED
FAILURE:构建失败并出现异常。
- 出了什么问题:任务“:packageTest”执行失败。APK内相同路径的重复文件:LICENSE.txt