Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

3.5K
Views
new NativeEventEmitter()` was called with a non-null argument without the required `addListener` method

I cannot resolve the issue. When application loads react native throw warnings. new NativeEventEmitter() was called with a non-null argument without the required addListener method. WARN new NativeEventEmitter() was called with a non-null argument without the required removeListeners method.

over 4 years ago · Santiago Trujillo
5 answers
Answer question

0

This is likely due to the newest version of react-native. A lot of libraries still haven't released a new version to handle these warnings (or errors in some case). Examples include https://github.com/react-navigation/react-navigation/issues/9882 and https://github.com/APSL/react-native-keyboard-aware-scroll-view/pull/501. If it bothers you, you can hide the warning for now (source):

import { LogBox } from 'react-native';
LogBox.ignoreLogs(['new NativeEventEmitter']); // Ignore log notification by message
LogBox.ignoreAllLogs(); //Ignore all log notifications
over 4 years ago · Santiago Trujillo Report

0

I just add two function to main java module:

    // Required for rn built in EventEmitter Calls.
    @ReactMethod
    public void addListener(String eventName) {

    }

    @ReactMethod
    public void removeListeners(Integer count) {

    }

Example: for fix warning in react-native-fs add functions to android/src/main/java/com/rnfs/RNFSManager.java file.

over 4 years ago · Santiago Trujillo Report

0

It is the issue related with react native reanimated library. I solve it by uninstalling the library and reinstalling it. Remove all the installation steps of react-native-reanimated library provided by https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/installation.

Simply install library using command npm install react-native-reanimated@2.3.0-beta.1

If the issue still then open project in android studio. Go to file->invalidate cache. After it all things work right.

over 4 years ago · Santiago Trujillo Report

0

same error.

change

const eventEmitter = new NativeEventEmitter(NativeModules.CustomModule);

to

const eventEmitter = new NativeEventEmitter();

works

over 4 years ago · Santiago Trujillo Report

0

1- update your react-native-reanimated library to "react-native-reanimated": "2.0.0"

2- You should update the babel.config.json file and add react-native-reanimated/plugin to plugins

module.exports = {
  presets: ['module:metro-react-native-babel-preset'],
  plugins: [
    "react-native-reanimated/plugin",
  ],
};

This will fix your issue

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!