Unable to build the app . Build failed with an exception
Environment
IDEs: Android Studio: Version 2.3.0.0 AI-162.4069837 npmPackages: react: 16.9.0 => 16.9.0 react-native: 0.61.2 => 0.61.2
**
THE PROBLEM:
UNABLE TO BUILD THE APP. I FOLLOWED ALL THE STEPS OF THE OFFICIAL DOCUMENTATION...DOWLOADED EVERYTHING CONNECTED MY DEVICE TO THE DEVELOPEMENT SERVER USING ADB REVERSE....
**
this is how it went..
C:\Users\Sakshi\monkey>react-native run-android
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 863 file(s) to forward-jetify. Using 4 workers...
info JS server already running.
The system cannot find the path specified.
info Launching emulator...
error Failed to launch emulator. Reason: No emulators found as an output of `emulator -list-avds`.
warn Please launch an emulator manually or connect a device. Otherwise app may fail to launch.
info Installing the app...
:ReactNative:Cannot run program "npx": CreateProcess error=2, The system cannot find the file specified
:ReactNative:Automatic import of native modules failed.
FAILURE: Build failed with an exception.
* Where:
Script 'C:\Users\Sakshi\monkey\node_modules\@react-native-community\cli-platform-android\native_modules.gradle' line: 169
* What went wrong:
A problem occurred evaluating script.
> Cannot invoke method getErrorStream() on null object
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 1s
error Failed to install the app. Make sure you have the Android development environment set up: https://facebook.github.io/react-native/docs/getting-started.html#android-development-environment. Run CLI with --verbose flag for more details.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
FAILURE: Build failed with an exception.
* Where:
Script 'C:\Users\Sakshi\monkey\node_modules\@react-native-community\cli-platform-android\native_modules.gradle' line: 169
* What went wrong:
A problem occurred evaluating script.
> Cannot invoke method getErrorStream() on null object
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 1s
at checkExecSyncError (child_process.js:621:11)
at execFileSync (child_process.js:639:15)
at runOnAllDevices (C:\Users\Sakshi\monkey\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:94:39)
at processTicksAndRejections (internal/process/task_queues.js:89:5)
Duplicate of #795
Duplicate of #795
few things are different in the beginning his code deals with something called npx... there is nothing like that...please suggest me an easy way to run my app... i have already tried expo that too gets stuck while downloading js bundle... i followed each n every step on the guide still i have problems. even it mentions that it failed to start the emulator.
Please read carefully: ReactNative:Cannot run program "npx": CreateProcess error=2 That's exactly the same issue.