Cannot find symbol “messaging” in com.google.fireb

2020-02-29 00:17发布

问题:

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.

回答1:

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.