java.lang.NoSuchMethodError:类Lcom / google / firebase / FirebaseApp中没有虚拟方法zzbqo()Z;

时间:2018-11-18 07:24:42

标签: java android

这是我得到的错误:

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.example.akash.firedemo-Tniw8sNtmq6E7zMSOD54YQ==/split_lib_dependencies_apk.apk)
    at com.google.firebase.database.FirebaseDatabase.getInstance(Unknown Source:128)
    at com.google.firebase.database.FirebaseDatabase.getInstance(Unknown Source:22)
    at com.example.akash.firedemo.MainActivity.onCreate(MainActivity.java:29)

1 个答案:

答案 0 :(得分:1)

您应该升级库。
首先,在项目build.gradle文件中,添加以下内容:

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

然后,在模块build.gradle文件中,添加以下内容:

implementation 'com.google.firebase:firebase-auth:16.0.5'
implementation 'com.google.firebase:firebase-database:16.0.5'
implementation 'com.firebaseui:firebase-ui-auth:4.2.1'