Error "return type int is not compatible with Intent" when using the FirebaseMessagingService class

I need the FCM service in my application, I cannot use the FirebaseMessagingService class, it says:

Error:(24, 8) error: zzaa(Intent) in FirebaseMessagingService cannot override zzaa(Intent) in zzb return type int is not compatible with Intent 

here is my code

 public class MyFirebaseMessagingService extends FirebaseMessagingService { @Override public void onMessageReceived(RemoteMessage remoteMessage) { sendNotification(remoteMessage.getData().get("message")); } private void sendNotification(String messageBody) { // } } 

I use this version of the compile 'com.google.firebase:firebase-messaging:9.2.0' library compile 'com.google.firebase:firebase-messaging:9.2.0'

enter image description here

+5
source share
5 answers

I solved my problem, I used the latest version of google map and auth services

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

when I downgraded to 9.2.0 , it was resolved

+4
source

I fixed the same problem in my case by changing this:

 compile 'com.google.android.gms:play-services-ads:9.4.0' compile 'com.google.firebase:firebase-messaging:9.2.1' compile 'com.google.firebase:firebase-core:9.2.1' 

To:

 compile 'com.google.android.gms:play-services-ads:9.2.0' compile 'com.google.firebase:firebase-messaging:9.2.0' compile 'com.google.firebase:firebase-core:9.2.0' 

Just make this whole version the same.

+7
source

Try starting all services with the same version. In this case, change

 compile 'com.google.firebase:firebase-messaging:9.0.2' 

to

 compile 'com.google.firebase:firebase-messaging:9.2.0 

and see if the same problem happens.

+5
source

Why would you give up? It’s better to damage the version of com.google.firebase: firebase-messaging to match the version of the game services (9.4.0 in your case), and you are ready to go.

So compile 'com.google.firebase:firebase-messaging:9.4.0' will do the trick.

+2
source

https://firebase.google.com/docs/android/setup

Please use the latest google-services and firebase plugin.

If you get a "Could not find" message, make sure you have the latest Google repository in the Android SDK manager.

0
source

All Articles