我一如既往地开发了一个React Native项目;当我做完后遇到以下错误 react-native run android
或者等价的 cd android && ./gradlew installDebug
。
这个异常被捕获的最后一步就是:`
:app:assembleDebug
:app:installDebug
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(DeviceMonitor.java:847)
at com.android.ddmlib.DeviceMonitor$DeviceListMonitorTask.run(DeviceMonitor.java:781)
at java.lang.Thread.run(Thread.java:745)
> Building 97% > :app:installDebug`
我正在编写反应原生版本0.43.2和react-native-cli 2.0.1,也是npm 4.1.2和纱线0.21.3; Ubuntu 16.04。所以一切都是最新版本的武装,但我仍然无法弄清楚问题。它甚至发生在我刚创建的项目中 react-native init
,它是每个地方。 :(
附:确保我的模拟器已启动并运行,问题不在于它。