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
Se llamó al nuevo NativeEventEmitter()` con un argumento no nulo sin el método `addListener` requerido

No puedo resolver el problema. Cuando las cargas de la aplicación reaccionan, lanzan advertencias nativas. Se llamó al new NativeEventEmitter() con un argumento no nulo sin el método addListener requerido. Se llamó a WARN new NativeEventEmitter() con un argumento no nulo sin el método removeListeners requerido.

over 4 years ago · Santiago Trujillo
5 answers
Answer question

0

Esto probablemente se deba a la versión más reciente de react-native. Muchas bibliotecas aún no han lanzado una nueva versión para manejar estas advertencias (o errores en algunos casos). Los ejemplos incluyen https://github.com/react-navigation/react-navigation/issues/9882 yhttps://github.com/APSL/react-native-keyboard-aware-scroll-view/pull/501 . Si te molesta, puedes ocultar la advertencia por ahora ( fuente ):

 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

Solo agrego dos funciones al módulo principal de Java:

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

Ejemplo: para corregir la advertencia en react-native-fs agregue funciones al archivo android/src/main/java/com/rnfs/RNFSManager.java .

over 4 years ago · Santiago Trujillo Report

0

Es el problema relacionado con la biblioteca reanimada nativa de reacción. Lo soluciono desinstalando la biblioteca y volviendo a instalarla. Elimine todos los pasos de instalación de la biblioteca react-native-reanimated proporcionada por https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/installation .

Simplemente instale la biblioteca usando el comando npm install react-native-reanimated@2.3.0-beta.1

Si el problema persiste, abra el proyecto en Android Studio. Vaya a archivo->invalidar caché. Después de todo, todo funciona bien.

over 4 years ago · Santiago Trujillo Report

0

mismo error.

cambiar

 const eventEmitter = new NativeEventEmitter(NativeModules.CustomModule);

para

 const eventEmitter = new NativeEventEmitter();

obras

over 4 years ago · Santiago Trujillo Report

0

1- actualice su biblioteca react-native-reanimated a "react-native-reanimated": "2.0.0"

2- Debe actualizar el archivo babel.config.json y agregar react-native-reanimated/plugin a los complementos

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

Esto solucionará tu problema.

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!