gpt4 book ai didi

java.lang.NoSuchMethodError : No static method zzb(ZLjava/lang/Object;)V in class Lcom/google/android/gms/common/internal/zzaa; or its super classes 错误

转载 作者:行者123 更新时间:2023-11-30 00:15:35 26 4
gpt4 key购买 nike

我查看了 Firebase 文档,然后搜索了所有 github 问题以及所有堆栈溢出帖子,但我仍然一次又一次地收到此错误。我被困了几个小时,请看一下。它说——

java.lang.NoSuchMethodError: No static method zzb(ZLjava/lang/Object;)V in class Lcom/google/android/gms/common/internal/zzaa; or its super classes (declaration of 'com.google.android.gms.common.internal.zzaa' appears in /data/app/com.masquerade.priyanshu.topcoder-2/split_lib_dependencies_apk.apk)

根据其他堆栈溢出帖子,当我尝试更改 firebase 核心和数据库版本时,我又收到一堆错误,说版本不兼容。

这是build.gradle(Module: app)

apply plugin: 'com.android.application'
repositories {
mavenLocal()
flatDir {
dirs 'libs'
}
}

android {
compileSdkVersion 26
buildToolsVersion '26.0.2'

defaultConfig {
applicationId "com.masquerade.priyanshu.topcoder"
minSdkVersion 16
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
// implementation 'com.android.support:appcompat-v7:26.1.0'
compile 'com.android.support:appcompat-v7:26.1.0'
compile 'com.android.support:design:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
//

compile 'com.google.firebase:firebase-core:11.6.0'
compile 'com.android.support:design:26.1.0'
compile 'com.google.firebase:firebase-database:11.6.0'
compile 'com.firebaseui:firebase-ui-storage:1.0.0'
// Displaying images
compile 'com.github.bumptech.glide:glide:3.6.1'
compile 'com.android.support:cardview-v7:21.+'
}
apply plugin: 'com.google.gms.google-services'

这是 build.gradle( Project:app ) -

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {

repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
classpath 'com.google.gms:google-services:3.1.1'


// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

allprojects {
repositories {
google()
jcenter()
mavenLocal()
maven {
url 'https://maven.fabric.io/public'
}

}
}

task clean(type: Delete) {
delete rootProject.buildDir
}

编辑 -此外,我在 compile 'com.google.firebase:firebase-core:11.6.0'

上收到此警告

警告是——

All gms/firebase libraries must use the exact same version specification (mixing versions can lead to runtime crashes). Found versions 11.6.0, 11.4.2. Examples include com.google.android.gms:play-services-basement:11.6.0 and com.google.firebase:firebase-storage:11.4.

最佳答案

要解决此问题,请更改 build.gradle( Project:app ) 文件中的以下代码行:

url 'https://maven.fabric.io/public'

url "https://maven.google.com" // Google's Maven repository

同时更改这行代码:

compile 'com.firebaseui:firebase-ui-storage:1.0.0'

compile 'com.firebaseui:firebase-ui-storage:3.1.0'

同时更改这行代码:

compile 'com.google.firebase:firebase-core:11.6.0'
compile 'com.google.firebase:firebase-database:11.6.0'

compile 'com.google.firebase:firebase-core:11.4.2'
compile 'com.google.firebase:firebase-database:11.4.2'

因为 Firebase/Play 服务版本 11.4.2FirebaseUI 版本 3.1.0 一起使用,如 here 所示.

同时在默认配置中将 multiDexEnabled 设置为 true。

关于java.lang.NoSuchMethodError : No static method zzb(ZLjava/lang/Object;)V in class Lcom/google/android/gms/common/internal/zzaa; or its super classes 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47365127/

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