0

我有一個Android模擬器在我的本地機器上運行有以下選項:反應原生Android模擬器的問題

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

,我試圖運行在模擬器上通過下面的反應天然樣品app命令

react-native run-android 

運行良好第一時間和我的文件區域的變化體現在模擬器中的應用,但一段時間後,我的更改不會反映並得到錯誤的應用

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

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

通過調用

react-native run-android 

得到下面的錯誤再次啓動應用程序時

> 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) 

可以識別的問題有人幫助反應機軟件包 和Android模擬器連接問題(它一些時間 和ch後斷開在文件中的時代已不再可以在 模擬器上的應用程序中查看)

+1

運行反應原生運行Android的命令後。您必須在項目文件夾中使用react-native start命令啓動服務器。然後重新加載你的應用程序 –

+1

我沒有使用「反應本地啓動」命令第一次,它工作正常 – AutoMEta

回答

-1

在cmd中運行「adb devices」。如果你看到「模擬器-5554離線」,只是做,因爲這answer

1

如果您的仿真器上有應用程序,如果您使用本機代碼,則必須使用 react-native start,如果您在設備上使用Expo,則必須使用npm start。然後在您的設備上運行您的應用程序並重新加載,以便您的打包服務器可以連接到您的模擬器。