当我试图运行我的Android程序时,出现了以下错误。
Error:Execution failed for task ':app:transformClassesWithPreJackPackagedLibrariesForDebug'. java.lang.AssertionError: java.util.zip.ZipException: duplicate entry: jayce/org/hamcrest/BaseDescription.jayce
这是我的build.gradle文件。
android {
compileSdkVersion 25
buildToolsVersion "25.0.3"
defaultConfig {
applicationId "com.surgical.decision"
minSdkVersion 15
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
jackOptions {
enabled true
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile files('libs/simple-xml-2.7.1.jar')
compile files('libs/log4j-1.2.17.jar')
compile files('libs/pddl4j-3.5.0.jar')
}
我必须启用jackOptions,因为我的许多函数是在Java 8中编写的。