gpt4 book ai didi

android - 多个dex文件定义Lcom/google/android/gms/internal/zzbqy;

转载 作者:行者123 更新时间:2023-11-29 17:01:10 24 4
gpt4 key购买 nike

错误:将字节码转换为 dex 时出错:Cause: com.android.dex.DexException: Multiple dex files define Lcom/google/android/gms/internal/zzbqy;

这个错误出现在我的 android 聊天应用程序中,我在这里找到了几个答案,但它无法解决我的问题。我正在为我的项目使用 Firebase,我已经成功完成了用户身份验证,并想在实时数据库中应用他们的照片和用户名,但这个错误阻止了进一步的开发。出现此错误我做错了什么?

构建.gradle

apply plugin: 'com.android.application'

android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.example.john.androidchat"
minSdkVersion 16
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.1.0'
compile 'com.android.support:design:25.1.0'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'de.hdodenhof:circleimageview:2.1.0'
compile 'com.google.code.gson:gson:2.8.0'
compile 'com.synnapps:carouselview:0.0.10'
compile 'com.google.firebase:firebase-auth:10.2.0'
compile 'com.google.firebase:firebase-database:10.2.0'
compile 'com.android.support.constraint:constraint-layout:1.0.1'
compile 'com.google.firebase:firebase-storage:10.0.1'
testCompile 'junit:junit:4.12'
}

apply plugin: 'com.google.gms.google-services'

最佳答案

在您的应用中启用 Multidex 并增加堆大小。

例如 build.gradle

安卓{

compileSdkVersion 23
buildToolsVersion "24.0.2"
defaultConfig {

minSdkVersion 16
targetSdkVersion 23
versionCode 1
versionName "1.0"

multiDexEnabled true
}

dexOptions {
javaMaxHeapSize "4g"
}

依赖关系{

compile 'com.android.support:multidex:1.0.1'

在您的 list 中的 Application 标记内编写以下代码

android:name="android.support.multidex.MultiDexApplication"

关于android - 多个dex文件定义Lcom/google/android/gms/internal/zzbqy;,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42944190/

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