我正在尝试将 firebase 通知集成到现有的 android 应用程序中。但是当应用程序启动时它会崩溃。
Process: uk.co.stableweb.geethika, PID: 24344
java.lang.IncompatibleClassChangeError: com.google.firebase.auth.FirebaseAuth
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 java.lang.ClassLoader.loadClass(ClassLoader.java:511)
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.zzeh(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:5233)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:4828)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4768)
at android.app.ActivityThread.access$1600(ActivityThread.java:154)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1441)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:152)
at android.app.ActivityThread.main(ActivityThread.java:5497)
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)
07-18 10:47:24.284 24344-24344/uk.co.stableweb.geethika D/AppTracker: App Event: crash
这是app.grade。
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:design:23.4.0'
compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha4'
compile 'com.google.firebase:firebase-core:9.2.0'
compile 'com.google.firebase:firebase-database:9.2.0'
compile 'com.android.support:cardview-v7:23.4.0'
compile 'com.android.support:recyclerview-v7:23.4.0'
compile 'com.firebaseui:firebase-ui:0.4.1'
compile 'com.firebaseui:firebase-ui-database:0.4.1'
compile 'com.firebaseui:firebase-ui-auth:0.4.1'
compile 'org.sufficientlysecure:html-textview:1.6'
compile 'com.android.support:support-v4:23.4.0'
compile 'cn.pedant.sweetalert:library:1.3'
compile 'com.google.firebase:firebase-messaging:9.2.1'
在 stackoverflow 的另一个问题中,有人建议启用身份验证。即使我不使用身份验证,我也启用了匿名选项。
我更新了设备和 SDK 中的谷歌存储库和播放服务。如果您对如何解决此问题有任何想法,那就太好了。谢谢!