Open praptoherlambang opened 1 year ago
Same issue
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.
}
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?!
I can't find this java file inside android folder, is there another fix?
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
this is so annoying.
new NativeEventEmitter()
was called with a non-null argument without the requiredaddListener
method.new NativeEventEmitter()
was called with a non-null argument without the requiredremoveListeners
method.how fix this issues guys..