未找到Notifee本地模块
我有一个带有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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
为我工作
如果您使用的是zegocloud videocalling。
compilesdkversion = 33 // -----------------------------------------------------------》在Android/build.gradle中更改此此事
work for me
if you are using ZEGOCLOUD videocalling .
compileSdkVersion = 33 // <----- change this in android/build.gradle
停止您的项目,关闭运行的终端窗口,然后在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