gpt4 book ai didi

android - 无法在 Android Studio 中构建 apk 文件

转载 作者:太空狗 更新时间:2023-10-29 13:53:44 25 4
gpt4 key购买 nike

我正在尝试构建 apk 但我无法创建它。出现以下错误。但项目运行成功。我的 android studio 版本 2.2.2

Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'. > com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/android/gms/common/api/zzd.class

我的 gradle 文件是:

apply plugin: 'com.android.application'

android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.wedding.weddingapp"
minSdkVersion 16
targetSdkVersion 23
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
configurations { all*.exclude module: 'gson-2.5' }
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

repositories {
maven { url "https://raw.githubusercontent.com/layerhq/releases-android/master/releases/" }
maven { url "https://raw.githubusercontent.com/layerhq/Atlas-Android/master/releases/" }
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})

compile 'com.android.support:multidex:1.0.0'
compile 'com.layer.atlas:layer-atlas:0.3.6'
compile 'com.google.firebase:firebase-messaging:9.8.0'
compile 'com.android.support:appcompat-v7:25.1.0'
compile 'com.android.support:design:25.1.0'
compile 'com.android.volley:volley:1.0.0'
compile 'de.hdodenhof:circleimageview:2.1.0'
compile 'com.android.support:support-v4:25.1.0'
compile 'com.facebook.android:facebook-android-sdk:4.+'
compile 'com.android.support:cardview-v7:25.1.0'


testCompile 'junit:junit:4.12'
}

// ADD THIS AT THE BOTTOM
apply plugin: 'com.google.gms.google-services'

最佳答案

你得到了

TransformException: java.util.zip.ZipException: duplicate entry: com/google/android/gms/common/api/zzd.class

您应该使用最新版本的 Firebase

 compile 'com.google.firebase:firebase-messaging:10.0.1'

和使用

 buildToolsVersion "25.0.1"

Thean 清理-重建-重启您的 IDE

关于android - 无法在 Android Studio 中构建 apk 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42087490/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com