我有一个带有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代码、Android Studio模拟器和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",
...
},
2条答案
按热度按时间1szpjjfi1#
停止您的项目,关闭正在运行的终端窗口,然后在您的android studio上按下“将项目与gradle文件同步”图标,您可以在设备管理器后面的顶栏上找到它
重新运行项目
hjzp0vay2#
"为我工作"
如果您正在使用ZEGOCLOUD视频通话。
compileSdkVersion = 33 //〈-----在android/build.gradle中更改此内容