ak1394 / react-native-tts

React Native Text-To-Speech library for Android and iOS
621 stars 156 forks source link

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

Open chenyunlin1 opened 8 months ago

chenyunlin1 commented 8 months ago

These two warnings are reported after use,How to solve this warn? new NativeEventEmitter() was called with a non-null argument without the required addListener method. new NativeEventEmitter() was called with a non-null argument without the required removeListeners method.

ofer-shaham commented 8 months ago

+1

chenyunlin1 commented 8 months ago

+1 solution:https://github.com/ak1394/react-native-tts/issues/247

jakubmarchwiany commented 6 months ago

+1

rahul-shah-g commented 6 months ago

+1

vishaldybot commented 5 months ago

+1

aravindIapparel commented 5 months ago

+1

sonnv106 commented 3 months ago

same

aravindIapparel commented 3 months ago

add this line under /your project/node_modules/react-native-tts/android/src/main/java/net/no_mad/tts/TextToSpeechModule.java

    @ReactMethod
    public void removeListeners(Integer count) {
        // Keep: Required for RN built in Event Emitter Calls.
    }

    @ReactMethod
    public void addListener(String eventName) {
        // Keep: Required for RN built in Event Emitter Calls.
    }
Screenshot 2024-07-10 at 12 34 08 in the afternoon Screenshot 2024-07-10 at 12 35 39 in the afternoon
walterholohan commented 3 months ago

If you raise a PR I will merge and deploy for you