10

I am trying to access FirebaseMessagingService using firebase 9.2.1 library. I have successfully created a project then download the JSON file. I have finally integrated this JSON file with my project. FirebaseInstanceIDService is running fine but showing error with FirebaseMessagingService. So i checked my project folder inside android studio. Then i find that firebase-messaging 9.2.1 library is missing. How can i resolve this issue. I have already upgraded all of the SDK libraries. Please help me to fix this issue.

enter image description here

enter image description here

enter image description here

Shravan Jain
  • 720
  • 1
  • 11
  • 32

1 Answers1

41

You need to add Firebase Messaging to your dependencies:

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

Setup for Firebase Cloud Messaging is explained in the documentation.

Bob Snyder
  • 37,759
  • 6
  • 111
  • 158
  • Also note that you don't need to explicitly depend on firebase-core – Arthur Thompson Jul 30 '16 at 00:01
  • Thanks, buddy! But I already had > compile 'com.google.firebase:firebase-core:12.0.0' dependency in my project. Then why was it showing an error? Why did the error go away when I added your dependency. Thanks. – prasang7 Apr 06 '18 at 00:50
  • @prasang7 FCM needed these two firebase core and firebase-messaging dependency to implement PN. If you want to use other firebase services you need to add another firebase dependency. thanks – Rajneesh Shukla Apr 07 '20 at 05:28