在android studio中构建项目时出现以下错误
com.android.build.api.transform.TransformException: java.util.zip.ZipException: 重复条目: android/support/annotation/ArrayRes.class
我的build.gradle文件
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.example.android.instagram_project"
minSdkVersion 16
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
defaultConfig {
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.squareup.picasso:picasso:2.5.2'
}
这是我项目中lib文件夹的截图 http://i.stack.imgur.com/qDjL4.jpg
最佳答案
从 libs 目录中删除 Android 支持库。由于您使用的是 gradle 并已指示与 appcompat-v7
的编译依赖关系,因此您无需手动包含 JAR。这导致在构建时与重复符号发生冲突。将其列为编译依赖项将导致 gradle 与 Maven 一起自动提取库(及其依赖项)。
关于java - Android Studio 中的 TransformException : java. util.zip.ZipException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35129198/