com.google.firebase.iid.zzf无法转换为com.google.android.gms.iid.zzi

时间:2018-09-27 10:07:12

标签: android react-native push-notification react-native-push-notification

  1. 使用以下库:react-native-push-notification,版本3.1.1

  2. 当android收到远程通知时,应用程序崩溃,但这在ios中没有问题

  3. 所有错误:

  

java.lang.ClassCastException:com.google.firebase.iid.zzf无法转换为com.google.android.gms.iid.zzi           在com.google.android.gms.iid.zzk.onServiceConnected(未知来源:4)           在android.app.LoadedApk $ ServiceDispatcher.doConnected(LoadedApk.java:1658)           在android.app.LoadedApk $ ServiceDispatcher $ RunConnection.run(LoadedApk.java:1687)           在android.os.Handler.handleCallback(Handler.java:789)           在android.os.Handler.dispatchMessage(Handler.java:98)           在android.os.Looper.loop(Looper.java:164)           在android.app.ActivityThread.main(ActivityThread.java:6944)           在java.lang.reflect.Method.invoke(本机方法)           在com.android.internal.os.Zygote $ MethodAndArgsCaller.run(Zygote.java:327)

  1. build.gradle
  

googlePlayServicesVersion =“ +”

     

Blockquote

     

firebaseVersion =“ +”

     

compileSdkVersion = 27

     

buildToolsVersion = '27 .0.3'

     

targetSdkVersion = 27

     

supportLibVersion =“ 27.0.1”

1 个答案:

答案 0 :(得分:0)

只需使用与27.0.3兼容的依赖项,就将firebaseVersion和googlePlayServicesVersion =“ +”替换为dependecies版本。