Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new NativeEventEmitter() warning after adding the lib #179

Open
theahmadzai opened this issue Jun 29, 2022 · 6 comments
Open

new NativeEventEmitter() warning after adding the lib #179

theahmadzai opened this issue Jun 29, 2022 · 6 comments
Labels
bug Something isn't working

Comments

@theahmadzai
Copy link

theahmadzai commented Jun 29, 2022

new NativeEventEmitter() warning

Just installed the library by following the guide, I set up everything correctly but now getting this warning whenever the app starts

`new NativeEventEmitter()` was called with a non-null argument without the required `removeListeners` method.

image

  • platform: Android
  • OS and version: 31
  • dev environment: Windows
  • In-App Payments Plugin version: 1.7.2
System:
    OS: Windows 10 10.0.22000
    CPU: (12) x64 AMD Ryzen 5 3600 6-Core Processor
    Memory: 4.22 GB / 15.93 GB
  Binaries:
    Node: 16.13.1 - C:\Program Files\nodejs\node.EXE
    Yarn: Not Found
    npm: 8.1.2 - C:\Program Files\nodejs\npm.CMD
    Watchman: Not Found
  SDKs:
    Android SDK: Not Found
    Windows SDK: Not Found
  IDEs:
    Android Studio: AI-212.5712.43.2112.8609683
    Visual Studio: 16.11.32106.194 (Visual Studio Community 2019)
  Languages:
    Java: Not Found
  npmPackages:
    @react-native-community/cli: Not Found
    react: 17.0.2 => 17.0.2
    react-native: 0.68.2 => 0.68.2
    react-native-windows: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

Can anybody help me what's causing this issue or how can I get rid of this

@theahmadzai theahmadzai added the bug Something isn't working label Jun 29, 2022
@dutradotdev
Copy link

+1

1 similar comment
@cicatrizdev
Copy link

+1

@CharmisG
Copy link
Contributor

@dutradotdev @pedrocmello

Sorry for the delay !!!

Put this in index.js for remove the warnings :

import { LogBox } from 'react-native';
LogBox.ignoreLogs(['new NativeEventEmitter']); // Ignore log notification by message
LogBox.ignoreAllLogs(); //Ignore all log notifications

@labmorales
Copy link

That's not a good solution at all.

@CharmisG
Copy link
Contributor

Please add below 2 lines in SquareInAppPaymentsModule.java file,

@ReactMethod
public void addListener(String eventName) {

}

@ReactMethod
public void removeListeners(Integer count) {

}

@labmorales

@CharmisG CharmisG reopened this Jan 24, 2023
@fobos531
Copy link

@CharmisG Ideally, that's something that should be added at the library level, not by every user of the library

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants