我正在使用firebase为我的Android应用程序,我试图实现firebase ui auth。虽然它出于某种原因试图在firebase上做任何其他事情,但却产生了这个我无法理解的奇怪错误。如果我注释掉库,那么其余的代码就可以了。 这是我得到的错误:
E/AndroidRuntime: FATAL EXCEPTION: main
Process: my process, PID: 21371
java.lang.NoSuchMethodError: No virtual method zzEq()Z in class Lcom/google/firebase/FirebaseApp; or its super classes (declaration of 'com.google.firebase.FirebaseApp' appears in /data/app/ke.co.ziqi.testlesdge-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 ke.co.ziqi.testlesdge.Groups.Channels.onCreate(Channels.java:80)
at android.app.Activity.performCreate(Activity.java:6439)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1108)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2498)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2605)
at android.app.ActivityThread.access$1100(ActivityThread.java:165)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1473)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:179)
at android.app.ActivityThread.main(ActivityThread.java:5730)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:681)
当我尝试通读实时数据库时,出现错误的行。当我删除库它可以正常工作。 users = FirebaseDatabase.getInstance()。getReference()。child(" users")。child(username).child(" groups");
gradle (app)
compile 'com.android.support:appcompat-v7:26.+'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:design:26.+'
compile 'com.android.support:cardview-v7:26.0.0-alpha1'
compile 'com.android.support:recyclerview-v7:26.0.0-alpha1'
compile 'com.google.firebase:firebase-auth:11.0.4'
compile 'com.google.firebase:firebase-core:11.0.4'
compile 'com.google.firebase:firebase-database:11.0.4'
compile 'com.google.firebase:firebase-messaging:11.0.4'
compile 'com.google.firebase:firebase-config:11.0.4'
compile 'com.google.firebase:firebase-storage:11.0.4'
compile 'com.firebaseui:firebase-ui-auth:3.1.2'
compile 'com.google.firebase:firebase-invites:11.0.4'
compile 'com.flipboard:bottomsheet-core:1.5.3'
compile 'com.flipboard:bottomsheet-commons:1.5.3'
compile 'de.hdodenhof:circleimageview:2.1.0'
compile 'com.github.bumptech.glide:glide:3.6.1'
compile 'org.jsoup:jsoup:1.10.3'
testCompile 'junit:junit:4.12'
gradle(project)
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.google.gms:google-services:3.1.0'
classpath "io.realm:realm-gradle-plugin:3.7.2"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
答案 0 :(得分:1)
为了解决这个问题,请更改以下代码:
compile 'com.firebaseui:firebase-ui-auth:3.1.2'
与
compile 'com.firebaseui:firebase-ui-auth:2.3.0'
Firebase / Play服务版本 11.0.4
与FirebaseUI版本 2.3.0
兼容。