Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ReactNative build for android just freezes over the last step

I was developing a React Native project as always; when I encountered the following error after doing react-native run android or equivalently cd android && ./gradlew installDebug. It's just over the last step that this exception is caught:`

: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`

I'm coding on react-native version 0.43.2 and react-native-cli 2.0.1, also npm 4.1.2 and yarn 0.21.3; Ubuntu 16.04. So everything is armed to teeth by the latest version but I still can't figure out the problem. It happens even for a project I just create by react-native init, it's every where. :( P.S. be sure my emulator is up and running and the problem isn't due to it.

like image 274
Bat Avatar asked Apr 06 '17 21:04

Bat


People also ask

How do I fix a freeze app in React Native?

killing the application from memory - after starting the application it works again (just by closing where the application is running in the background and starting it from there doesn't help) reinstalling the application ( react-native run-android ) - works again.

Is it necessary to install Android Studio for React Native?

You will need Node, the React Native command line interface, a JDK, and Android Studio. While you can use any editor of your choice to develop your app, you will need to install Android Studio in order to set up the necessary tooling to build your React Native app for Android.

Is react easier than Android studio?

When assessing the two solutions, reviewers found Android Studio easier to use and administer. However, reviewers preferred the ease of set up, and doing business with React Native overall. Reviewers felt that Android Studio meets the needs of their business better than React Native.


1 Answers

Try restarting adb in to make it probe the local 5554 port

killall adb; adb devices
like image 133
Avatar Avatar answered Oct 24 '22 05:10

Avatar