Can not resolve symbol "FirebaseMessagingService"

11.5k views Asked by At

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

4

There are 4 answers

1
John O'Reilly On BEST ANSWER

you also need to add

compile "com.google.firebase:firebase-messaging:$PLAY_SERVICES_VERSION"
0
Gabriele Mariotti On

You have to add another dependency:

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

Check the official doc.

0
Balu mallisetty On
dependencies {    
      implementation 'com.google.firebase:firebase-messaging:21.0.0'
}
0
Sagar On

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'
 }