skip to Main Content

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

2

Answers


  1. 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

    Login or Signup to reply.
  2. work for me
    if you are using ZEGOCLOUD videocalling .

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

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search