Java Lcom/google/firebase/FirebaseApp 类中没有虚拟方法 zzbqo()Z;或其超类('com.google.firebase.FirebaseApp' 的声明

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/51336198/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-11 00:05:05  来源:igfitidea点击:

No virtual method zzbqo()Z in class Lcom/google/firebase/FirebaseApp; or its super classes (declaration of 'com.google.firebase.FirebaseApp'

javaandroidfirebasefirebase-realtime-databasefirebaseui

提问by Sunil Meena

In my android app, there is an error while compiling the app. I am working in the latest android studio and using Firebase UI Auth and Firebase Database all the versions are in same in App level Grade file then why I am getting this error

在我的 android 应用程序中,编译应用程序时出现错误。我在最新的 android studio 中工作,并使用 Firebase UI Auth 和 Firebase 数据库,所有版本在应用级成绩文件中都相同,那么为什么我会收到此错误

Error:

错误:

E/AndroidRuntime: FATAL EXCEPTION: main
              Process: com.dotndash.abjb.vishwakarmajanganna, PID: 7689
              java.lang.NoSuchMethodError: No virtual method zzbqo()Z in class Lcom/google/firebase/FirebaseApp; or its super classes (declaration of 'com.google.firebase.FirebaseApp' appears in /data/app/com.dotndash.abjb.vishwakarmajanganna-1/split_lib_dependencies_apk.apk)
                  at com.google.firebase.database.FirebaseDatabase.getInstance(Unknown Source)
                  at com.google.firebase.database.FirebaseDatabase.getInstance(Unknown Source)
                  at com.dotndash.abjb.vishwakarmajanganna.RegisterActivity.onCreate(RegisterActivity.java:38)
                  at android.app.Activity.performCreate(Activity.java:6956)
                  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1126)
                  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2927)
                  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3045)
                  at android.app.ActivityThread.-wrap14(ActivityThread.java)
                  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1642)
                  at android.os.Handler.dispatchMessage(Handler.java:102)
                  at android.os.Looper.loop(Looper.java:154)
                  at android.app.ActivityThread.main(ActivityThread.java:6776)
                  at java.lang.reflect.Method.invoke(Native Method)
                  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1518)
                  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1408)

Build.gradle

构建.gradle

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation 'com.google.firebase:firebase-database:11.8.0'
implementation 'com.google.firebase:firebase-auth:11.8.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.firebaseui:firebase-ui-auth:4.0.0'
}

采纳答案by Peter Haddad

Upgrade the following:

升级以下内容:

implementation 'com.google.firebase:firebase-database:11.8.0'
implementation 'com.google.firebase:firebase-auth:11.8.0'
implementation 'com.firebaseui:firebase-ui-auth:4.0.0'

to this:

对此:

implementation 'com.google.firebase:firebase-auth:16.0.2'
implementation 'com.google.firebase:firebase-database:16.0.1'
implementation 'com.firebaseui:firebase-ui-auth:4.1.0'

also add:

还添加:

implementation 'com.google.firebase:firebase-core:16.0.1'

In the top level gradle file upgrade the google-service plugin:

在顶级 gradle 文件中升级 google-service 插件:

classpath 'com.google.gms:google-services:4.0.1'

https://firebase.google.com/support/release-notes/android

https://firebase.google.com/support/release-notes/android

The firebaseui needs to be compatible with the firebase versions, check the following link for more information:

firebaseui 需要与 firebase 版本兼容,查看以下链接了解更多信息:

https://github.com/firebase/FirebaseUI-Android/blob/master/README.md#dependencies

https://github.com/firebase/FirebaseUI-Android/blob/master/README.md#dependencies

回答by Theodore

These have been updated to the following:

这些已更新为以下内容:

implementation 'com.firebaseui:firebase-ui-auth:4.3.1'
implementation 'com.google.firebase:firebase-auth:18.1.0'