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

How to remove Warn new NativeEventEmitter ? #237

Open
praptoherlambang opened this issue Jan 23, 2023 · 5 comments
Open

How to remove Warn new NativeEventEmitter ? #237

praptoherlambang opened this issue Jan 23, 2023 · 5 comments

Comments

@praptoherlambang
Copy link

praptoherlambang commented Jan 23, 2023

this is so annoying.

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.

how fix this issues guys..

@praptoherlambang praptoherlambang changed the title No Sound On Android - 2023 How to remove Warn new NativeEventEmitter ? Jan 23, 2023
@celciusjj
Copy link

Same issue

@vito-mish
Copy link

vito-mish commented Feb 26, 2023

node_modules/react-native-tts/android/src/main/java/net/no_mad/tts/TextToSpeechModule.java

Just add this.

    @ReactMethod
    public void addListener(String eventName) {
        // Keep: Required for RN built in Event Emitter Calls.
    }

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

Ref this PR:
https://github.com/invertase/react-native-firebase/pull/5616/files#diff-c887076b0c80d540aed1bfbb472cc8f20516634e8e72d53014c65d690bba4fb1

vito-mish added a commit to vito-mish/go-timer that referenced this issue Feb 26, 2023
…n-null argument without the required `addListener` method.

[How]
ak1394/react-native-tts#237
@NoobFullStack
Copy link

I tried to 'just' add the provided code snippets inside
node_modules/react-native-tts/android/src/main/java/net/no_mad/tts/TextToSpeechModule.java

but when running npx react-native run-android I get the following error:

BUILD FAILED in 7s

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
D:\Development\MobileApps\AwesomeProject\node_modules\react-native-tts\android\src\main\java\net\no_mad\tts\TextToSpeechModule.java:531: error: class, interface, or enum expected
    public void addListener(String eventName) {
           ^
D:\Development\MobileApps\AwesomeProject\node_modules\react-native-tts\android\src\main\java\net\no_mad\tts\TextToSpeechModule.java:536: error: class, interface, or enum expected
    public void removeListeners(double count) {
           ^
2 errors

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':react-native-tts:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

Could you clarify a bit more? As the PR is a whole other file than the file you mention?!

@syednomishah
Copy link

I can't find this java file inside android folder, is there another fix?

@haiffy420
Copy link

I can't find this java file inside android folder, is there another fix?

it's inside node_modules folder. if you're using VS Code,

CTRL + P > Paste node_modules/react-native-tts/android/src/main/java/net/no_mad/tts/TextToSpeechModule.java > Enter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants