'node_modules/.bin/react-native run-android --no-packager' (error code 101) (error code 303)

I am not able to solve the above error when running Android build by debug config or by command npx react-native run-android.

I have checked and Configured the ANDROID_HOME environment variable as well but no luck.

I have also gone through the react-native official instruction for setup https://reactnative.dev/docs/environment-setup

I got the below error in the OUTPUT window. [Error] Error: Error while executing command '/Users/apple/Desktop/xxxxxxxxx/node_modules/.bin/react-native run-android --no-packager' (error code 101)



Solution 1:[1]

You need to define the ANDROID_SDK_ROOT environment variable (source), or define the sdk.dir variable in your project's android/local.properties file.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 fleuryc