React-native-push-notification: com.google.firebase.iid.zzf cannot be cast to com.google.android.gms.iid.zzi

Created on 27 Sep 2018  路  4Comments  路  Source: zo0r/react-native-push-notification

  1. use the library version 3.1.1
  2. the app crash when the android receive a remote notification, but it's no problem in the ios
  3. all the error:

java.lang.ClassCastException: com.google.firebase.iid.zzf cannot be cast to com.google.android.gms.iid.zzi
at com.google.android.gms.iid.zzk.onServiceConnected(Unknown Source:4)
at android.app.LoadedApk$ServiceDispatcher.doConnected(LoadedApk.java:1658)
at android.app.LoadedApk$ServiceDispatcher$RunConnection.run(LoadedApk.java:1687)
at android.os.Handler.handleCallback(Handler.java:789)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6944)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)

  1. build.gradle

googlePlayServicesVersion = "+" // default: "+"
firebaseVersion ="+"
compileSdkVersion = 27 // default: 23
buildToolsVersion = '27.0.3' // default: "25.0.2"
targetSdkVersion = 27 // default: 22
supportLibVersion = "27.0.1"

Stale

Most helpful comment

If you are using GCM, please make sure that you are using RNPushNotificationListenerServiceGcm in AndroidManifest.xml:

<service android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationListenerServiceGcm" android:exported="false" > <intent-filter> <action android:name="com.google.android.c2dm.intent.RECEIVE" /> </intent-filter> </service>

Not RNPushNotificationListenerService, that was used on previous versions.

All 4 comments

I removed supportLibVersion = "27.0.1" from ext, and also make sure your app/build.gradle has the same #s with a root gradle. I am only day 2 on this project, so also discovering things along the way. I am on RN 44.

This works:
https://github.com/zo0r/react-native-push-notification/issues/796#issuecomment-410801969

My problem was using FCM, (I setup for GCM, and my manifest was wrong).

If you are using GCM, please make sure that you are using RNPushNotificationListenerServiceGcm in AndroidManifest.xml:

<service android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationListenerServiceGcm" android:exported="false" > <intent-filter> <action android:name="com.google.android.c2dm.intent.RECEIVE" /> </intent-filter> </service>

Not RNPushNotificationListenerService, that was used on previous versions.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 30 days if no further activity occurs. Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Benzer1406 picture Benzer1406  路  3Comments

ssolida picture ssolida  路  3Comments

NiuQiaoling picture NiuQiaoling  路  3Comments

selimonline picture selimonline  路  3Comments

edwinharly picture edwinharly  路  3Comments