error running npx React-Native run-android command

Asked

Viewed 559 times

-2

Create a new project in React Activate with tamplete in typescript and while running the android Yarn command or even the npx React-Native run-android I am getting the following error:

error Failed to start the app.
Error: spawnSync adb ENOENT
   at Object.spawnSync (internal/child_process.js:1041:20)
   at Object.spawnSync (child_process.js:616:24)
   at Function.module.exports.sync (/home/thayller/Developer/estudo/rocketseat/gostack 
11/appgobarber/node_modules/execa/index.js:334:30)
  at tryLaunchAppOnDevice (/home/thayller/Developer/estudo/rocketseat/gostack 
11/appgobarber/node_modules/@react-native-community/cli-platform- 
 android/build/commands/runAndroid/tryLaunchAppOnDevice.js:57:22)
 at /home/thayller/Developer/estudo/rocketseat/gostack 11/appgobarber/node_modules/@react- 
 native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:104:39
  at Array.forEach (<anonymous>)
  at runOnAllDevices (/home/thayller/Developer/estudo/rocketseat/gostack 
11/appgobarber/node_modules/@react-native-community/cli-platform- 
  android/build/commands/runAndroid/runOnAllDevices.js:102:48)
   at processTicksAndRejections (internal/process/task_queues.js:97:5)
   at async Command.handleAction (/home/thayller/Developer/estudo/rocketseat/gostack 
11/appgobarber/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.

Someone who’s been through the same thing or who understands what’s going on to help me, because I haven’t found out for the moment

  • Take a look at the PATH and make sure the path to the Android SDK is present.

2 answers

0


I executed the command:

npx react-native doctor

that returned me the following log:

Common
 ✓ Node.js
 ✓ yarn

Android
 ✖ JDK
  - Version found: 1.8.0_252
  - Version supported: >= 8
✓ ANDROID_HOME
✖ Android SDK - Required for building and installing your app on Android
 - Versions found: N/A
 - Version supported: 28.0.3

Errors:   2

On that basis I reinstalled the android studio, and I re-configured the environment variables and it works.

-1

Did you install the project packages? wheel yarn in the root, to download the node_modules then rotate yarn ios or yarn android, to run your project

If it doesn’t work, You may not have the android SDK installed,

  • yes packages are installed initially, this occurs at the exact moment build tries to install in emulator / cell phone the project

Browser other questions tagged

You are not signed in. Login or sign up in order to post.