I have set my IP and made sure it's right but when I executereact-native run-android
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.
you need to stop npm server. then hit following command in terminal.
adb kill-server
adb start-server
than start npm server
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.
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 :)
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).