Home » Android » android – Can not resolve symbol "FirebaseMessagingService"

android – Can not resolve symbol "FirebaseMessagingService"

Posted by: admin June 15, 2020 Leave a comment

Questions:

I’m tring to integrate Firebase Cloud Messaging in android app but facing problem to extend FirebaseMessagingService in our class.

It displaying Can not resolve symbol “FirebaseMessagingService”

app.gradle

compile 'com.google.firebase:firebase-core:10.0.1'
compile 'com.google.firebase:firebase-database:9.8.0'

and also add google-service.json file

How to&Answers:

you also need to add

compile "com.google.firebase:firebase-messaging:$PLAY_SERVICES_VERSION"

Answer:

You have to add another dependency:

dependencies {
     compile 'com.google.firebase:firebase-messaging:10.0.1'
}

Check the official doc.

Answer:

Add these dependencies it will solve your problem

dependencies {
 compile 'com.google.firebase:firebase-core:9.0.0'
 compile 'com.google.firebase:firebase-messaging:9.4.0'
 }