当我更新 Android Studio 3.0 时,出现错误
unable to merge with dex.
然后我添加了mutiDexEnabled true
,还在build.gradle
中添加了com.android.support:multidex:1.0.1
。
然后我得到以下错误:
Error:Execution failed for task ':app:transformClassesWithMultidexlistForDebug'. java.io.IOException: Can't write [C:\Users\user\AndroidStudioProjects\KnightFox-IN BUDGET\app\build\intermediates\multi-dex\debug\componentClasses.jar] (Can't read [C:\Users\user.gradle\caches\transforms-1\files-1.1\play-services-ads-lite-11.4.2.aar\9a54afd7907fee993ecc421b66ed4228\jars\classes.jar(;;;;;;**.class)] (Duplicate zip entry [classes.jar:com/google/ads/mediation/MediationServerParameters$Parameter.class]))
构建.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion '26.0.2'
defaultConfig {
applicationId "com.copperseeds.android.kunjachamman.applicationin.budget"
minSdkVersion 14
targetSdkVersion 26
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt'
}
}
}
dependencies {
implementation files('libs/ksoap2-android-assembly-2.6.0-jar-with-dependencies.jar')
implementation fileTree(include: ['*.jar'], dir: 'libs')
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation 'com.android.support:appcompat-v7:26.0.0'
implementation 'com.android.support:support-annotations:26.0.0'
implementation 'com.android.support:support-v4:26.0.0'
implementation 'com.github.navasmdc:MaterialDesign:1.5@aar'
testImplementation 'junit:junit:4.12'
implementation project(':ORMDroid')
implementation project(':FacebookSDK')
implementation project(':standOut')
implementation files('libs/gcm.jar')
implementation files('libs/google-play-services.jar')
implementation 'com.google.android.gms:play-services:+'
compile 'com.android.support:multidex:1.0.1'
}
最佳答案
尝试删除应用程序的构建文件夹,而不是清理-重建-运行您的项目。 如果不起作用,则执行 Invalidate Caches/Restart。
编码愉快!!
关于android - 将android studio更新到3.0后任务执行失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47069903/