React Native Error: spawnSync adb ENOENT error on Android

Viewed 3372

I'm working on a react-native app and i keep getting this error when i try to launch the debugger. Everything works fine when i'm using expo but when i try it with the built in react-native debugger on Android the Build is successful but after that it crashes.

I'm using :

react native version: 16.11.0

npm version: 6.12.0

yarn version: 1.22.4

BUILD SUCCESSFUL in 10s
167 actionable tasks: 2 executed, 165 up-to-date
info Connecting to the development server...
warn Failed to connect to development server using "adb reverse": spawnSync adb ENOENT
info Starting the app...
error Failed to start the app. Run CLI with --verbose flag for more details.
Error: spawnSync adb ENOENT
at Object.spawnSync (internal/child_process.js:1041:20)
at Object.spawnSync (child_process.js:607:24)
at Function.module.exports.sync (/Users/<user>/Desktop/Personelijk/DEV/React-Native/DOTB_2/ReactNavigationAuthenticationFlowsWithHooks/node_modules/execa/index.js:334:30)
at tryLaunchAppOnDevice (/Users/<user>/Desktop/Personelijk/DEV/React-Native/DOTB_2/ReactNavigationAuthenticationFlowsWithHooks/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/tryLaunchAppOnDevice.js:57:22)
at /Users/<user>/Desktop/Personelijk/DEV/React-Native/DOTB_2/ReactNavigationAuthenticationFlowsWithHooks/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:104:39
at Array.forEach (<anonymous>)
at runOnAllDevices (/Users/<user>/Desktop/Personelijk/DEV/React-Native/DOTB_2/ReactNavigationAuthenticationFlowsWithHooks/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:102:48)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async Command.handleAction (/Users/<user>/Desktop/Personelijk/DEV/React-Native/DOTB_2/ReactNavigationAuthenticationFlowsWithHooks/node_modules/@react-native-community/cli/build/index.js:186:9)error Command failed with exit code 1.info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
1 Answers

fixed the issue by running :

./adb reverse tcp:8081 tcp:8081

and reloading the server

Related