未找到Notifee本地模块

发布于 2025-02-06 16:46:35 字数 975 浏览 3 评论 0原文

我有一个带有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.

我正在使用Visual Studio Code,Android Studio Emulator和JDK 11在Ubuntu 20.04.4 Lts上使用。

我的软件包中的相关包: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",
     ...
  },

I have a mobile app with React Native and works without any problem. I wanted to add notification functionality to that app.

I installed firebase/app, firebase/messaging and @notifiee for being able to send notifications. After installed these packages, I am able to build my app on android emulator but i'm getting error on the console like this:

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.

I'm using Visual Studio Code, Android Studio Emulator and JDK 11 on an Ubuntu 20.04.4 LTS.

Relevant packages in my 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",
     ...
  },

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

掐死时间 2025-02-13 16:46:35

为我工作
如果您使用的是zegocloud videocalling。

compilesdkversion = 33 // -----------------------------------------------------------》在Android/build.gradle中更改此此事

work for me
if you are using ZEGOCLOUD videocalling .

compileSdkVersion = 33 // <----- change this in android/build.gradle

メ斷腸人バ 2025-02-13 16:46:35

停止您的项目,关闭运行的终端窗口,然后在Android Studio上按在“使用Gradle文件的同步项目”图标上按照图标,您可以在设备管理器后面的顶级栏上找到

stop your project, close the running terminal window and on your android studio press on the "sync project with gradle files" icon, you can find it on the top bar behind the device manager

re-run your project

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文