繁体   English   中英

找不到 Notifee 本机模块

[英]Notifee native module not found

我有一个带有 React Native 的移动应用程序并且可以正常工作。 我想向该应用程序添加通知功能。

我安装了 firebase/app、firebase/messaging 和 @notifiee 以便能够发送通知。 安装这些包后,我可以在 android 模拟器上构建我的应用程序,但我在控制台上遇到这样的错误:

ERROR    Error: Notifee native module not found.
LOG      Running "myMobileApp" with {"rootTag":1}
ERROR    Invariant Violation: "myMobileApp" has not been registered. This can happen if:
* Metro (the local dev server) is run from the wrong folder. Check if Metro is running, stop it and restart it in the current project.
* A module failed to load due to an error and `AppRegistry.registerComponent` wasn't called.

我在 Ubuntu 20.04.4 LTS 上使用 Visual Studio Code、Android Studio Emulator 和 JDK 11。

我的package.json中的相关包:

"dependencies": {
     ...
    "@notifee/react-native": "^5.3.0",
    "@react-native-firebase/app": "^14.11.0",
    "@react-native-firebase/messaging": "^14.11.0",
    "react": "16.13.1",
    "react-native": "0.63.4",
     ...
  },

停止您的项目,关闭正在运行的终端 window 并在您的 android 工作室上按“与 gradle 文件同步项目”图标,您可以在设备管理器后面的顶部栏中找到它

重新运行你的项目

为我工作
如果您正在使用 ZEGOCLOUD 视频通话。

compileSdkVersion = 33 // <----- 在 android/build.gradle 中改变这个

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM