18

When I run my React Native app on my Android device, I get this error: Error Message I found this answer but it is not running for me: Answer. Further I'm using React Native on Ubuntu and React Native isn't create local.properties (sdk.dir=/path/to/sdk/) and I need to change buildToolsVersion "23.0.1" to "23.0.3". I want to auto make those.

Community
  • 1
  • 1
İbrahim
  • 991
  • 1
  • 10
  • 32

6 Answers6

30

This getting started tutorial says:

A common issue is that the packager is not started automatically when you run react-native run-android. You can start it manually using react-native start.

and it solved my same problem.

Burak Yildiz
  • 462
  • 4
  • 9
  • this work for me. on my other laptop `react-native run-android` launch the other console (opened by `start`) itself. anyway to do it ? – AlainIb Jun 12 '17 at 11:50
5

Did you setup the ip/port to the dev server on the device?

If not shake the device to get the dev menu, click "Dev Settings" / "Debug server host & port for device".

alireza amini
  • 1,712
  • 1
  • 18
  • 33
Sven
  • 124
  • 4
  • 2
    In general, following the steps in http://facebook.github.io/react-native/docs/running-on-device-android.html#configure-your-app-to-connect-to-the-local-dev-server-via-wi-fi can be very useful for solving this kind of problem. – Tomty Sep 13 '16 at 00:56
  • I kept looking at this answer and not really getting what was meant by "shake the device" or somehow mentally dismissing it. This is actually what it means. Shake your android device and that brings up the development menu and then you follow the steps above or on the linked react-native docs. – flyingace Nov 08 '16 at 05:16
2

Make sure the command adb(android device bridge) is in your path.

h--n
  • 5,903
  • 4
  • 31
  • 32
1

Disabling mobile data/wifi connection on my emulator's device caused this error for me.

The connection was disabled to test offline/PWA functions.

My answer won't help the OP, but I'll leave it here for future Googlers.

Winfred
  • 33
  • 1
  • 6
0

Below commands worked for me

1.react-native run-android
2.react-native start

execute 1 command i.e 'react-native run-android' it will show you red screen with BatchedBridge error, then execute 2 command i.e 'react-native start' then just reload the emulator error disappears.

Jasmine John
  • 873
  • 8
  • 12
-1

Use following commands on cmd and it will work fine.

npm uninstall -g react-native-cli npm cache clean

npm install -g react-native-cli

react-native start

react-native run-android

Sandip Lawate
  • 456
  • 3
  • 11