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)
googlePlayServicesVersion = "+" // default: "+"
firebaseVersion ="+"
compileSdkVersion = 27 // default: 23
buildToolsVersion = '27.0.3' // default: "25.0.2"
targetSdkVersion = 27 // default: 22
supportLibVersion = "27.0.1"
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.
Most helpful comment
If you are using GCM, please make sure that you are using
RNPushNotificationListenerServiceGcminAndroidManifest.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.