[英]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.