voice icon indicating copy to clipboard operation
voice copied to clipboard

(NOBRIDGE) ERROR [TypeError: Cannot read property 'startSpeech' of null] facing in react-native 0.76.3 version

Open VJ-Rahavan opened this issue 1 year ago • 21 comments

Here's my package.json file image

I’m using the same package with React Native 0.74, and it works perfectly. But with React Native 0.76, I’m running into this error. It could be because React Native 0.76 uses bridgeless mode, which might be causing the problem.

image

VJ-Rahavan avatar Dec 03 '24 10:12 VJ-Rahavan

It's working fine if I just disabled the new architecture. image

VJ-Rahavan avatar Dec 03 '24 10:12 VJ-Rahavan

Is there a way to fix this issue in react-native 0.76 with new architecture

VJ-Rahavan avatar Dec 03 '24 10:12 VJ-Rahavan

I experience this too. But only in Android. iOS seems fine.

Kvizas avatar Dec 05 '24 17:12 Kvizas

I see this PR is opened to support new arch

Abdulmalick-Dimnang avatar Dec 07 '24 13:12 Abdulmalick-Dimnang

I had the same problem with the new architecture, is there a merge provision in the PR?

jluanv avatar Dec 16 '24 21:12 jluanv

This PR fixed the issue for me! 🎉

edencakir avatar Dec 22 '24 09:12 edencakir

how to fix this issue? I'm having the same issue

krishnakhadka200416 avatar Jan 03 '25 19:01 krishnakhadka200416

In React Native 0.77.0 the Voice is not being loaded

_events : onSpeechStart: ƒ, onSpeechRecognized: ƒ, onSpeechEnd: ƒ, onSpeechError: ƒ, onSpeechResults: ƒ, onSpeechPartialResults: ƒ, onSpeechVolumeChanged: ƒ} _listeners : null _loaded : false

Aniket239 avatar Feb 05 '25 07:02 Aniket239

In React Native 0.77.0 the Voice is not being loaded

_events : onSpeechStart: ƒ, onSpeechRecognized: ƒ, onSpeechEnd: ƒ, onSpeechError: ƒ, onSpeechResults: ƒ, onSpeechPartialResults: ƒ, onSpeechVolumeChanged: ƒ} _listeners : null _loaded : false

downgrade your react native version or use this https://github.com/react-native-voice/voice/pull/526 you should type "yarn add SolankiYogesh/voice#new-arch"

anhnguyenhaiPG avatar Feb 05 '25 07:02 anhnguyenhaiPG

Is there any way of installing "yarn add SolankiYogesh/voice#new-arch" using npm?

Aniket239 avatar Feb 05 '25 07:02 Aniket239

Is there any way of installing "yarn add SolankiYogesh/voice#new-arch" using npm?

if you use npm, try "npm install SolankiYogesh/voice#new-arch"

anhnguyenhaiPG avatar Feb 05 '25 07:02 anhnguyenhaiPG

Using npm i am getting these errors.

PS E:\projects\pinkpaws-ios> npm install SolankiYogesh/voice#new-arch npm error code 1 npm error git dep preparation failed npm error command C:\Program Files\nodejs\node.exe C:\Users\altis\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js install --force --cache=C:\Users\altis\AppData\Local\npm-cache --prefer-offline=false --prefer-online=false --offline=false --no-progress --no-save --no-audit --include=dev --include=peer --include=optional --no-package-lock-only --no-dry-run npm error > @react-native-voice/[email protected] prepare npm error > yarn build && yarn build:plugin npm error npm warn using --force Recommended protections disabled. npm error npm warn ERESOLVE overriding peer dependency npm error npm warn While resolving: @react-native-community/[email protected] npm error npm warn Found: [email protected] npm error npm warn node_modules/eslint npm error npm warn dev eslint@"^6.8.0" from the root project npm error npm warn 2 more (@typescript-eslint/eslint-plugin, @typescript-eslint/parser) npm error npm warn npm error npm warn Could not resolve dependency: npm error npm warn peer eslint@">=8" from @react-native-community/[email protected] npm error npm warn node_modules/@react-native-community/eslint-config npm error npm warn dev @react-native-community/eslint-config@"^3.2.0" from the root project npm error npm warn ERESOLVE overriding peer dependency npm error npm warn While resolving: @babel/[email protected] npm error npm warn Found: [email protected] npm error npm warn node_modules/eslint npm error npm warn dev eslint@"^6.8.0" from the root project npm error npm warn 2 more (@typescript-eslint/eslint-plugin, @typescript-eslint/parser) npm error npm warn npm error npm warn Could not resolve dependency: npm error npm warn peer eslint@"^7.5.0 || ^8.0.0 || ^9.0.0" from @babel/[email protected] npm error npm warn node_modules/@babel/eslint-parser npm error npm warn @babel/eslint-parser@"^7.18.2" from @react-native-community/[email protected] npm error npm warn node_modules/@react-native-community/eslint-config npm error npm warn 1 more (eslint-plugin-ft-flow) npm error npm warn ERESOLVE overriding peer dependency npm error npm warn While resolving: [email protected] npm error npm warn Found: [email protected] npm error npm warn node_modules/eslint npm error npm warn dev eslint@"^6.8.0" from the root project npm error npm warn 2 more (@typescript-eslint/eslint-plugin, @typescript-eslint/parser) npm error npm warn npm error npm warn Could not resolve dependency: npm error npm warn peer eslint@">=7.0.0" from [email protected] npm error npm warn node_modules/eslint-config-prettier npm error npm warn eslint-config-prettier@"^8.5.0" from @react-native-community/[email protected] npm error npm warn node_modules/@react-native-community/eslint-config npm error npm warn ERESOLVE overriding peer dependency npm error npm warn While resolving: [email protected] npm error npm warn Found: [email protected] npm error npm warn node_modules/eslint npm error npm warn dev eslint@"^6.8.0" from the root project npm error npm warn 2 more (@typescript-eslint/eslint-plugin, @typescript-eslint/parser) npm error npm warn npm error npm warn Could not resolve dependency: npm error npm warn peer eslint@"^8.1.0" from [email protected] npm error npm warn node_modules/eslint-plugin-ft-flow npm error npm warn eslint-plugin-ft-flow@"^2.0.1" from @react-native-community/[email protected] npm error npm warn node_modules/@react-native-community/eslint-config npm error npm warn ERESOLVE overriding peer dependency npm error npm warn While resolving: [email protected] npm error npm warn Found: [email protected] npm error npm warn node_modules/eslint npm error npm warn dev eslint@"^6.8.0" from the root project npm error npm warn 2 more (@typescript-eslint/eslint-plugin, @typescript-eslint/parser) npm error npm warn npm error npm warn Could not resolve dependency: npm error npm warn peer eslint@">=7.28.0" from [email protected] npm error npm warn node_modules/eslint-plugin-prettier npm error npm warn eslint-plugin-prettier@"^4.2.1" from @react-native-community/[email protected] npm error npm warn node_modules/@react-native-community/eslint-config npm error npm warn deprecated [email protected]: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful. npm error npm warn deprecated @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-nullish-coalescing-operator instead. npm error npm warn deprecated @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-class-properties instead. npm error npm warn deprecated [email protected]: Rimraf versions prior to v4 are no longer supported npm error npm warn deprecated @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-optional-chaining instead. npm error npm warn deprecated [email protected]: Rimraf versions prior to v4 are no longer supported npm error npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported npm error npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported npm error npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported npm error npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported npm error npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported npm error npm warn deprecated @xmldom/[email protected]: this version is no longer supported, please update to at least 0.8.* npm error npm warn deprecated [email protected]: This version is no longer supported. Please see https://eslint.org/version-support for other options. npm error 'yarn' is not recognized as an internal or external command, npm error operable program or batch file. npm error npm error code 1 npm error npm error path C:\Users\altis\AppData\Local\npm-cache_cacache\tmp\git-cloneMUXCH6 npm error npm error command failed npm error npm error command C:\WINDOWS\system32\cmd.exe /d /s /c yarn build && yarn build:plugin npm error npm error A complete log of this run can be found in: C:\Users\altis\AppData\Local\npm-cache_logs\2025-02-05T08_50_11_551Z-debug-0.log npm error A complete log of this run can be found in: C:\Users\altis\AppData\Local\npm-cache_logs\2025-02-05T08_50_01_935Z-debug-0.log

Aniket239 avatar Feb 05 '25 08:02 Aniket239

In React Native 0.77.0 the Voice is not being loaded

_events : onSpeechStart: ƒ, onSpeechRecognized: ƒ, onSpeechEnd: ƒ, onSpeechError: ƒ, onSpeechResults: ƒ, onSpeechPartialResults: ƒ, onSpeechVolumeChanged: ƒ} _listeners : null _loaded : false

facing same issue

surajllpl avatar Feb 07 '25 05:02 surajllpl

Solution for @react-native-community/voice Not Loading in React Native 0.77.0

  1. Disable New Architecture In your android/gradle.properties file, set:

    newArchEnabled=false

  2. Add Queries for Speech Recognition (For Android 11 and Above) Apps targeting Android 11 (API level 30) or higher need to declare interaction with the speech recognition service in AndroidManifest.xml. Add the following inside the tag:

Reference Android Speech Recognizer Documentation

surajllpl avatar Feb 17 '25 04:02 surajllpl

@surajllpl you missed something in point number 2 ?

codewitharun avatar Feb 19 '25 11:02 codewitharun

@surajllpl you missed something in point number 2 ?

Follow this --

Reference Android Speech Recognizer Documentation

surajllpl avatar Feb 25 '25 12:02 surajllpl

I could not install the change from the https://github.com/react-native-voice/voice/pull/526 since my company's network is behind corporate proxy. Is there any news when the new version is bumped?

The latest version is in 2022 which is 3 years ago.

aladine avatar Mar 12 '25 14:03 aladine

It's working fine if I just disabled the new architecture. image

it works for me even after i am using the latest versions.

"@react-native-voice/voice": "^3.2.4",
"react": "18.3.1",
"react-native": "0.77.0",

mschouhan123 avatar Mar 13 '25 18:03 mschouhan123

same issue

mushthak02 avatar Mar 26 '25 16:03 mushthak02

same issue

TypeError: Cannot read property 'startSpeech' of null

ezequiel88 avatar Jun 01 '25 17:06 ezequiel88

I'm still experiencing this issue specifically on Android, even after following all the steps mentioned here. The error is: TypeError: Cannot read property 'startSpeech' of null when calling Voice.start(). I'm using React Native CLI (not Expo), with the native module correctly linked, and all permissions granted. The issue happens both in debug and release builds. It only works if I set newArchEnabled=false, which suggests that the module might not be compatible with the new architecture yet. On iOS, everything works fine. Please consider reopening this issue or clarifying if Android + New Architecture support is planned.

The solution VJ-Rahavan worked for me. Thanks Man.

jsnavarroc avatar Jun 11 '25 23:06 jsnavarroc