1

i have a android emulator running in my local machine with below options:

emulator.exe -avd Nexus_5_API_22 -netdelay none -netspeed full

and i am trying to run the react native sample app on the simulator by below command

react-native run-android

it runs fine first time and my changes in the files area reflected in the app on emulator but after some time my changes are not reflected and getting error in the app

[![!\[enter image description here][1]][1]

https://i.stack.imgur.com/6syRP.jpg

when launching the app again by calling

 react-native run-android

getting below error

> Exception in thread "Device List Monitor"
> java.lang.NullPointerException
>         at com.android.ddmlib.EmulatorConsole.checkConnection(EmulatorConsole.java:317)
>         at com.android.ddmlib.EmulatorConsole.getConsole(EmulatorConsole.java:231)
>         at com.android.ddmlib.DeviceMonitor.queryAvdName(DeviceMonitor.java:248)
>         at com.android.ddmlib.DeviceMonitor.updateDevices(DeviceMonitor.java:220)
>         at com.android.ddmlib.DeviceMonitor.access$400(DeviceMonitor.java:65)
>         at com.android.ddmlib.DeviceMonitor$DeviceListUpdateListener.deviceListUpdate(DeviceMonitor.
> java:662)
>         at com.android.ddmlib.DeviceMonitor$DeviceListMonitorTask.processIncomingDeviceData(DeviceMo
> nitor.java:847)
>         at com.android.ddmlib.DeviceMonitor$DeviceListMonitorTask.run(DeviceMonitor.java:781)
>         at java.lang.Thread.run(Thread.java:745)

can someone help in identifying the problem of react native package and android emulator connectivity issue(it disconnect after some time and changes in the files are no longer can be viewed in the app on emulator)

AutoMEta
  • 1,339
  • 6
  • 22
  • 35
  • 1
    after you run the react-native run-android command. you must start you server with react-native start command in your project folder. then reload you app. – Irfan Ali Apr 12 '17 at 07:24
  • 1
    i did not use the "react-native start " command first time and it works fine – AutoMEta Apr 12 '17 at 08:47

2 Answers2

1

if you had application on your emulator, you must use react-native start if you use native code or use npm start if you use Expo on you device. And run your app on your device and do reload, so your packge server can connect to your emulator.

Sasongko Adi
  • 108
  • 1
  • 1
  • 7
0

Run "adb devices" in cmd. If you see "emulator-5554 offline", just do as this answer.

Community
  • 1
  • 1
Sean Song
  • 89
  • 4