I have set my IP and made sure it's right but when I executereact-native run-android
-
In my case, adb path was not set in the PATH variable. So I was getting the same error. So set path of sdk/platform-tools in your PATH environment variable. – Sunil Garg Jan 27 '18 at 05:55
8 Answers
i had the same problem , didn't knew what to do.
cd android
./gradlew clean
after that
react-native run-android
solved my problem
- 7,069
- 5
- 23
- 38
I resolved issue by:
1: Uninstalling app
2: Restart package: react-native run-android
- 20,585
- 22
- 95
- 108
- 6,144
- 2
- 34
- 42
This can happen when you have hot reloading enabled but you are in production mode. To use hot reloading, make sure you have __DEV__ set to true.
To check or change this, in a console type adb shell input keyevent 82, go to Dev Settings, and make sure JS Dev Mode is checked.
If you have remote JS debugging enabled, then you might also see a line in the console that looks like this:
Running application "yourapp" with appParams: {"rootTag":1}. __DEV__ === false, development-level warning are OFF, performance optimizations are ON
If that's the case, then this could be the cause of your problem.
- 573
- 1
- 5
- 11
you need to stop npm server. then hit following command in terminal.
adb kill-server
adb start-server
than start npm server
- 2,114
- 1
- 17
- 28
same error occurs to me when I switch off JS DEV Mode and enable Hot Reloading.I solved it by disable Hot Reloading.Hope it could help.
- 21
- 2
Santosh's answer is correct, but I couldn't use it, so for others who run into this problem and are as much of a newbie as I am at the moment... The adb that Santosh is restarting here is the Android Debugging Bridge. It seems to be at the heart of the Hot Reloading / remote debugging that's built into React Native. Basically, it got confused and needed resetting.
Alternate Solution
Trying to run adb failed for me, so I stopped the emulator, opened the Android Virtual Device manager (in Android Studio until Tools -> Android -> AVD Manager, and on the line for the particular phone I was emulating, I clicked the down arrow next to the edit (pencil) icon to the right and selected 'Wipe Data'. Then I restarted that device (the Play button just to the left of the edit (pencil) icon. Restarted my app via react-native run-ios and everything was fine.
More on Santosh's Solution
To do it Santosh's way, you need the Android SDK bin folder in your path, or to run the command with full path. It's in your Android SDK folder under platform-tools. Don't forget to re-enable Hot Reloading after restarting (if you're using it).
- 916
- 12
- 14
This issue come due to development server error.
Follow some steps to resolve this issue.
Step 1:
adb kill-server
adb start-server
then check your device/emulator is visible on command prompt or not.
adb devices
Step 2
Clean your gradle compiler files, some file may be corrupt.
android/gradlew clean
Step 3:
Remove application from your device/emulator.
Step 4:
react-native run-android
Now issue will be resoled :)
- 6,331
- 4
- 51
- 81
-
These steps are telling us everything about the state of JavaScript Development in 2018. I want to add that you sometimes have to perform the usual node routine of `rm rf node_modules && npm install`. – shredding Dec 10 '18 at 10:02
-
With this if it still doesnot work, then just manually uninstall the app from the emulator or actual device and again try running "react-native run-android" - this way it solved mine – Ritesh Kumar Apr 03 '19 at 21:03
if you using RN Debugger you must turn off firewall and try again, it's worked for me
- 11
- 2
