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.
Asked
Active
Viewed 2.4k times
10
-
Don't use screenshots, please. Copy your Gradle section into the question – OneCricketeer Jul 28 '16 at 15:54
-
Adding Firebase is now Very easy refer here http://stackoverflow.com/a/41564507/5996106 – karanatwal.github.io Jan 10 '17 at 09:15
1 Answers
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