在com.google.firebase.messaging.FirebaseMessagingService中找不到符号"消息"

Shr*_*ain 6 android firebase firebase-cloud-messaging

我正在尝试使用firebase 9.2.1库访问FirebaseMessagingService.我已经成功创建了一个项目,然后下载了JSON文件.我终于将这个JSON文件与我的项目集成在一起.FirebaseInstanceIDService正常运行,但FirebaseMessagingService显示错误.所以我检查了android studio中的项目文件夹.然后我发现firebase-messaging 9.2.1库丢失了.我该如何解决这个问题.我已经升级了所有SDK库.请帮我解决这个问题.

在此输入图像描述

在此输入图像描述

在此输入图像描述

Bob*_*der 33

您需要将Firebase消息传递添加到依赖项:

compile 'com.google.firebase:firebase-messaging:9.2.1'
Run Code Online (Sandbox Code Playgroud)

Firebase Cloud Messaging的设置在文档中进行了说明.