3

I am just starting to create a new react-native project and I followed the steps exactly as mentioned in setting-up environment for react-native.

My development OS: Mac; My target OS: Android

I created a local.properties file in my project/android directory which mentions sdk path. I have the android emulator up and running, then I do yarn react-native start, and in another terminal window, yarn react-native run:android but I get the following error:

BUILD SUCCESSFUL in 28s
27 actionable tasks: 27 executed
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:1066:20)
error Command failed with exit code 1.

yarn react-native run:ios command runs perfectly alright.

Could anyone help with this please? I have tried the various different suggestions mentioned in this stackoverflow question but no luck.

simongayle
  • 31
  • 3
  • can you launch emulator from other ways? for example from android studio itself? – AADProgramming Sep 10 '20 at 06:49
  • @AADProgramming yes I'm able to launch it directly from Android studio – simongayle Sep 10 '20 at 15:48
  • I'm getting the same error. can you fix it? – fmchan Oct 04 '20 at 13:46
  • @fmchan I was able to fix it by verifying that my path was set up correctly in bash profile. In my case, the paths were not being persisted because I wasn't adding them correctly. Ran the emulator from android studio, once it was up, the command was able to load my app. Hope this helps. Sorry for the late reply. – simongayle Nov 02 '20 at 03:08

0 Answers0