While i run react native android app in visual code i get this error. I need help to resolve this issue. Thanks.
FAILURE: Build failed with an exception.
What went wrong: A problem was found with the configuration of task ':app:installDebug'.
File 'C:\Users\Supun\AppData\Local\Android\Sdk\platform-tools\adb.exe' specified for property 'adbExe' does not exist.
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Get more help at https://help.gradle.org
BUILD FAILED in 4m 34s 26 actionable tasks: 26 executed Could not install the app on the device, read the error above for details. Make sure you have an Android emulator running or a device connected and have set up your Android development environment:
https://facebook.github.io/react-native/docs/getting-started.html
events.js:183
throw er; // Unhandled 'error' event
^
Error: spawn cmd.exe ENOENT
at _errnoException (util.js:1024:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:190:19)
at onErrorNT (internal/child_process.js:372:16)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickCallback (internal/process/next_tick.js:180:9)
Running your app on Android devices 1 Enable Debugging over USB Most Android devices can only install and run apps downloaded from Google Play, by default. ... 2 Plug in your device via USB Let's now set up an Android device to run our React Native projects. ... 3 Run your app
This is because synchronous methods require the JS VM to share memory with the app. For the Google Chrome debugger, React Native runs inside the JS VM in Google Chrome, and communicates asynchronously with the mobile devices via WebSockets. Once a native module is written, it needs to be registered with React Native.
However we recommend that you use ReactContextBaseJavaModule, as shown above. ReactContextBaseJavaModule gives access to the ReactApplicationContext (RAC), which is useful for Native Modules that need to hook into activity lifecycle methods.
Go to the root directory for your project and create a new package.json file with the following contents: Next, make sure you have installed the yarn package manager. Install the react and react-native packages. Open a terminal or command prompt, then navigate to the directory with your package.json file and run:
I know this is an old topic, but I'll post it here in case if anyone is having the same issue.
For me, this usually happens when WSL is being used, while Android SDK is installed under Windows (there you have adb.exe
instead of adb
).
Making another copy of adb.exe
binary as adb
resolved the issue for me:
copy adb.exe adb
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With