我試圖運行我的Android程序時出現此錯誤。Android:錯誤:任務應用程序執行失敗:transformClassesWithPreJackPackagedLibrariesForDebug
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