【发布时间】:2017-12-08 21:50:05
【问题描述】:
我在 Android Studio 中生成签名 APK 时遇到问题。
错误:任务 ':app:transformClassesWithMultidexlistForDebug' 执行失败。 java.io.IOException: 无法写入 [C:\Users\Ahmed\StudioProjects\android1\app\build\intermediates\multi-dex\debug\componentClasses.jar] (无法读取 [C:\Users\Ahmed .gradle\caches\transforms-1\files-1.1\support-compat-25.2.0.aar\8a6c38a056e2992b7f752213fb56ad15\jars\classes.jar(;;;;;;.class)] (重复的 zip 条目 [classes.jar: android/support/v4/view/ViewCompat.class]))
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion '26.0.2'
defaultConfig {
applicationId "com.ahmedkarray.switchsides.colorsdash"
minSdkVersion 16
targetSdkVersion 25
multiDexEnabled true
ndk {
moduleName "player_shared"
}
}
buildTypes {
release {
minifyEnabled false
shrinkResources false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
sourceSets.main {
jni.srcDirs = []// <-- disable automatic ndk-build call
}
}
android{
configurations {
all*.exclude group: 'com.android.support', module: 'support-v4'
all*.exclude group: 'com.android.support', module: 'support-annotations'
}
}
dependencies {
compile 'com.android.support:multidex:1.0.1'
compile ('com.google.android.gms:play-services:+'){exclude module: 'support-v4'}
compile files('libs/dagger-1.2.2.jar')
compile files('libs/javax.inject-1.jar')
compile files('libs/nineoldandroids-2.4.0.jar')
compile files('libs/support-v4-19.0.1.jar')
compile ('com.android.support:multidex:1.0.1')
compile 'com.android.support:support-annotations:27.0.2'
}
【问题讨论】: