Could not install the app on the device on react-native run-android

react-native run-android make sure you have an android emulator running or a device connected
failed to install the app. make sure you have the android development environment set up
make sure you have the android development environment setup react native
chmod 755 android/gradlew
install react native cli
error: command failed: ./gradlew app:installdebug -preactnativedevserverport=8081
failed to install on any devices
android environment setup error

I am unable to run any react-native project. It says there is already a process running. The port 8081 is taken by McAfee antivirus running on my MAC. And in no way I am able to kill it (even though I should not be killing it, I tried it, and looks like it never dies! SUDO has no power after all!)

Referring to #7308 #9145 and stackoverflow, I tried to run on port 8082. Server starts up, but, run-android still fails saying no device found. I have both my device (Galaxy S7 Edge with Debug mode on) and Genymotion open.

React Native version details -

SATJAGAN-M-T0HZ:react-native-card-modal satjagan$ react-native -v
react-native-cli: 1.0.0
react-native: 0.37.0

Genymotion active and available -

bozzmob:Twitter bozzmobusr$ adb devices
List of devices attached
192.168.57.101:5555 device

Terminal Logs of running the app- (Interestingly it says JS Server not recognized, is there any problem there)?

bozzmob:Twitter bozzmobusr$ react-native start --port 8082
Scanning 712 folders for symlinks in /Users/satjagan/collection/work/github/reactnative/react-native-card-modal/node_modules (15ms)
 ┌────────────────────────────────────────────────────────────────────────────┐ 
 │  Running packager on port 8082.                                            │ 
 │                                                                            │ 
 │  Keep this packager running while developing on any JS projects. Feel      │ 
 │  free to close this tab and run your own packager instance if you          │ 
 │  prefer.                                                                   │ 
 │                                                                            │ 
 │  https://github.com/facebook/react-native                                  │ 
 │                                                                            │ 
 └────────────────────────────────────────────────────────────────────────────┘ 
Looking for JS files in
   /Users/satjagan/collection/work/github/reactnative/react-native-card-modal 

[Hot Module Replacement] Server listening on /hot

React packager ready.

[11/26/2016, 2:47:25 PM] <START> Initializing Packager
[11/26/2016, 2:47:25 PM] <START> Building in-memory fs for JavaScript
[11/26/2016, 2:47:25 PM] <END>   Building in-memory fs for JavaScript (184ms)
[11/26/2016, 2:47:25 PM] <START> Building Haste Map
[11/26/2016, 2:47:25 PM] <END>   Building Haste Map (425ms)
[11/26/2016, 2:47:25 PM] <END>   Initializing Packager (741ms)



bozzmob:Twitter bozzmobusr$ react-native run-android
**JS server not recognized, continuing with build...**
Running adb -s 192.168.57.101:5555 reverse tcp:8081 tcp:8081
Building and installing the app on the device (cd android && ./gradlew installDebug...
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.
Go to https://facebook.github.io/react-native/docs/getting-started.html
and check the Android tab for setup instructions.

Unfortunately uninstalling McAfee is not an option :( I would have done it first if I had the freedom.

React-Native is still trying to connect to the packager on 8081. Usually you open the development menu and specify a different port, but in your case you can't even get started.

It doesn't appear that you can specify a port otherwise. I think you may have two options:

  1. Temporarily kill McAfee, install, and change the port via the development menu, as mentioned here: https://facebook.github.io/react-native/docs/troubleshooting.html#terminating-a-process-on-port-8081

  2. Change this file: https://github.com/facebook/react-native/blob/292cc82d0ebc437a6f1cdd2e972b3917b7ee05a4/Libraries/Core/Devtools/getDevServer.js

Could not install the app on the device, read the error , JS server already running. Building and installing the app on the device (cd android && gradlew.bat installDebug) FAILURE: Build failed with an� Search for React Native Development on fastquicksearch.com! Find React Native Development. Relevant Results on fastquicksearch

I had similar problem. I couldn't not stop the McAfee process via kill command. This was because it was running as a service. It could be stopped however by via lanuchctl tool. Try this:

cd /Library/LaunchDaemons sudo launchctl unload com.mcafee.agent.macmn.plist

It wil stop the McAfee process that is taking 8081 port.

react-native run-android, Could not install the app on the device , This seemed like a blanket try/catch error message so I dug in the the command mentioned cd android && ./gradlew installDebug. And when� Search for React Native Development Get Info at Consumersearch.com! Find React Native Development Get Info at Consumersearch.com!

react-native run-android "Could not install the app on the device , I am developing a react-native app. I work on it everyday, but today, I launch the command "react-native run-android" and I get this message: Starting JS server. You could run your app through a real device or an emulator. To start the app on Android, we need to execute npx react-native run-android, otherwise on iOS, npx react-native run-ios.

I find in almost all cases when you know the app should run with your current project settings and code, if it doesn't work, try:

killall -9 node

because the Metro Bundler node process is what is probably having the issue. Sometimes it gets bunged up.

That's what I do, but you can more-specifically look at what processes are holding port 8081 and kill those. (try a command like sudo lsof -n -i4TCP:8081 (cite: lsof definition). If you are running some node.js APIs on your localhost, you should perhaps be more careful with killing all node processes, but if you are just doing React Native dev, you can safely do that.

Could not install the app on the device, read the error above , Windows issue: Could not install app on the device, read the above for the details . while running "react-native run-android" command. mkonicek. Moved from� سلام وقتی توی کامند پرامت در مرحله اخر نصب react-native- run-android میزنم ارور زیر رو بهم میده FAILURE: Build failed with an exception. BUILD FAILED in 2m 1s Could not install the app on the device

Windows issue: Could not install app on the device , ReactNativeClient git:custom-android-editor-styles ❯ react-native error 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� jax$ react-native run-android Starting JS server Building and installing the app on the device (cd android &amp;&amp; ./gradlew installDebug Could not install the app on the device, read the

Error while building Android? - Development, It's always a good idea to test your app on an actual device before releasing it to Most Android devices can only install and run apps downloaded from Google If you get a "bridge configuration isn't available" error, see Using adb reverse. Could not install the app on the device - react native on windows 10. Ask Question Close studio and go back to command line, run react-native run-android.

Running On Device � React Native, react-native android emulator could not install the app on the device react-native run-android make sure you have an android emulator running or a device� The emulator work well on Android Studio but not when I run the command: react-native run-android If my device is connected to usb _ see the emulator on my phone. When I run the command without a device connected to usb

Comments
  • Thanks a lot for the reply. 1st approach isn't working as I suggested, McAfee comes back to life in few milliseconds after I kill it. I changed getDevServer.js file. But, I am still facing the same error as described in the question, which goes by- "Could not install the app on the device, read the error above for details."
  • Now I did a grep of '8081' and replaced 8081 with 8082 every single file. Still failing with the same error :(
  • When you run react-native run-android do you still see something like this: adb -s 192.168.57.101:5555 reverse tcp:8081 tcp:8081
  • No. I see 192.168.57.101:5555 reverse tcp:8299 tcp:8299... I changed port to 8299.
  • Good to know how to unload the McAfee Daemon. Thanks! :)