更新到android studio 2.1后,当我尝试使用新的gradle时,我的项目开始崩溃了:
错误:任务执行失败':app:transformClassesWithJarMergingForDebug'。> com.android.build.api.transform.TransformException:java.util.zip.ZipException:>重复条目:org / objectweb / asm / tree / AbstractInsnNode.class
摇篮:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "application.id.is.here"
minSdkVersion 16
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dataBinding
{
enabled = true
}
dexOptions {
javaMaxHeapSize "4g"
preDexLibraries = true
}
}
repositories {
mavenCentral()
}
dependencies {
//compile fileTree(dir: 'libs', include: ['*.jar'])
compile('com.mikepenz:materialdrawer:4.6.4@aar') {
transitive = true
}
compile 'com.android.support:multidex:1.0.1+'
compile 'com.facebook.android:facebook-android-sdk:4.+'
compile 'de.hdodenhof:circleimageview:2.0.0'
compile 'com.android.support:design:23.1.1'
compile 'com.nineoldandroids:library:2.4.0'
compile 'com.vk:androidsdk:+'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.android.tools.build:gradle:2.1.0+'
compile ('com.google.android.gms:play-services-maps:8.3.0'){
exclude group: 'com.android.support', module: 'support-v4'
}
compile 'com.squareup.retrofit:retrofit:1.9.0'
compile 'com.squareup.okhttp:okhttp:2.7.2+'
}
configurations {
all*.exclude group: 'commons-logging', module: 'commons-logging'
}
和顶级构建:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.0-alpha1'
}
}
allprojects {
repositories {
jcenter()
}
gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
如果您有任何想法 - 请帮忙。我发现这个问题没有找到任何解决方案。
答案 0 :(得分:0)
退出Android Studio,然后清除缓存:
cd ~/.gradle/caches
rm -r *
重新启动Android Studio,现在它应该可以正常工作。