编译期间遇到错误 - IncompatibleClassChangeError:类com.google.firebase.auth.FirebaseAuth

时间:2016-09-18 08:03:43

标签: android firebase firebase-authentication

整个代码都没有错误。但在运行应用程序时,我收到此错误。该应用程序是一个社交网络应用程序我还没有完成它。我只是想测试到目前为止我做了什么。

我正在使用firebase作为后端。我做了我知道应该做的所有事情。提前感谢任何人指出问题所在。

09-17 15:15:02.161 3113-3113/com.karpos.uiapp I/art: Not late-enabling -Xcheck:jni (already on)
09-17 15:15:02.182 3113-3119/com.karpos.uiapp E/art: Failed writing handshake bytes (-1 of 14): Broken pipe
09-17 15:15:02.182 3113-3119/com.karpos.uiapp I/art: Debugger is no longer active
09-17 15:15:02.259 3113-3113/com.karpos.uiapp W/System: ClassLoader referenced unknown path: /data/app/com.karpos.uiapp-1/lib/x86
09-17 15:15:15.057 3113-3113/com.karpos.uiapp W/System: ClassLoader referenced unknown path: /data/app/com.karpos.uiapp-1/lib/x86
09-17 15:15:15.163 3113-3113/com.karpos.uiapp D/AndroidRuntime: Shutting down VM
--------- beginning of crash
09-17 15:15:15.164 3113-3113/com.karpos.uiapp E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.karpos.uiapp, PID: 3113
    java.lang.IncompatibleClassChangeError: Class com.google.firebase.auth.FirebaseAuth implements non-interface class com.google.android.gms.internal.zzaja (declaration of 'com.google.firebase.auth.FirebaseAuth' appears in /data/data/com.karpos.uiapp/files/instant-run/dex/slice-com.google.firebase-firebase-auth-9.0.2_d242e5a275ef165dea6bef1054c16b85330841ce-classes.dex)
        at dalvik.system.DexFile.defineClassNative(Native Method)
        at dalvik.system.DexFile.defineClass(DexFile.java:226)
        at dalvik.system.DexFile.loadClassBinaryName(DexFile.java:219)
        at dalvik.system.DexPathList.findClass(DexPathList.java:338)
        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:54)
        at com.android.tools.fd.runtime.IncrementalClassLoader$DelegateClassLoader.findClass(IncrementalClassLoader.java:90)
        at com.android.tools.fd.runtime.IncrementalClassLoader.findClass(IncrementalClassLoader.java:62)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
        at java.lang.Class.classForName(Native Method)
        at java.lang.Class.forName(Class.java:324)
        at java.lang.Class.forName(Class.java:285)
        at com.google.firebase.FirebaseApp.zza(Unknown Source)
        at com.google.firebase.FirebaseApp.initializeApp(Unknown Source)
        at com.google.firebase.FirebaseApp.initializeApp(Unknown Source)
        at com.google.firebase.FirebaseApp.zzek(Unknown Source)
        at com.google.firebase.provider.FirebaseInitProvider.onCreate(Unknown Source)
        at android.content.ContentProvider.attachInfo(ContentProvider.java:1748)
        at android.content.ContentProvider.attachInfo(ContentProvider.java:1723)
        at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source)
        at android.app.ActivityThread.installProvider(ActivityThread.java:5153)
        at android.app.ActivityThread.installContentProviders(ActivityThread.java:4748)
        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4688)
        at android.app.ActivityThread.-wrap1(ActivityThread.java)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1405)
        at android.os.Handler.dispatchMessage(Handler.java:102)
        at android.os.Looper.loop(Looper.java:148)
        at android.app.ActivityThread.main(ActivityThread.java:5417)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
09-17 15:15:22.749 3113-3113/com.karpos.uiapp I/Process: Sending signal. PID: 3113 SIG: 9

1 个答案:

答案 0 :(得分:1)

确保拥有所有最新的firebase&谷歌播放相同版本的库。

compile 'com.google.android.gms:play-services:9.4.0'
compile 'com.google.firebase:firebase-core:9.4.0'
compile 'com.google.firebase:firebase-auth:9.4.0'