简体   繁体   中英

Notifee native module not found

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",
     ...
  },

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

work for me
if you are using ZEGOCLOUD videocalling.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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