【发布时间】:2016-03-16 13:45:06
【问题描述】:
在 android studio 中获取 gradle 文件错误。我使用了 mikepenz 库文件,但出现如下错误
com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/mikepenz/google_material_typeface_library/GoogleMaterial$Icon.class
下面是我的 gradle 文件,我在其中使用了 mikepenz 库作为图标
apply plugin: 'com.android.application'
List<String> dirs = [
'main',
'common',
'template']
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.example.demo"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled true
}
dexOptions {
incremental true
javaMaxHeapSize "2048M"
jumboMode = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
//Autocomplete address
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
// icon fonts used inside the sample
// https://github.com/mikepenz/Android-Iconics
compile 'com.mikepenz:iconics:1.6.2@aar'
compile 'com.mikepenz:iconics-core:1.6.2@aar'
compile 'com.mikepenz:google-material-typeface:2.2.0.1@aar'
compile 'com.mikepenz:fontawesome-typeface:4.4.0.1@aar'
compile 'com.mikepenz:octicons-typeface:3.0.0.1@aar'
compile 'com.mikepenz:entypo-typeface:1.0.0.1@aar'
compile 'com.github.clans:fab:1.6.2'
// used to showcase how to load images
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.github.bumptech.glide:glide:3.6.1'
请帮我解决这个问题,
提前谢谢..
【问题讨论】:
-
'File->Invalidate caches/Restart',重启后'Build --> Clean'和
Build --> Rebuild prohject应该做的事情。希望对你有帮助
标签: android android-studio build.gradle