Problems running "tns run android"



I cannot seem to figure out why I don’t have any connected devices found when running “tns run android”. I also ran “tns doctor” and have no issues found. Here is an output of the error. Thanks!


Does “tns device” or “tns device android --available-devices” list anything?

Did you setup any Adnroid emulator from AVD manager?


Thanks for your response. When I run those commands there are no devices. I set up the Android emulator by using ruby -e “$(curl -fsSL”. How do I do it from AVD manager?


Try setting it up from AVD manager in Android Studio.


Thanks for the help. At first I was not getting the same options until the tools tab in Android Studio but I found this link to fix that problem:

I then followed the steps in the link you provided and was successful in creating a virtual device which worked, but I ran into another issue. When I run “tns run android”, the device starts to run but I get an error. Thanks again for your help!


Great, did you try the suggestion of increasing the RAM of emulator in the error message?

Also did you start the emulator before running the tns run android?


I increased the RAM to 4096 and also tried changing the timeout to 300 but am still getting the same error. When you say start the emulator do you mean having Android Studio open? I am very new to this. I did come across the event log in Android Studio and I have an error. Thanks!


You need to set the ANDROID_SDK_ROOT to $ANDROID_HOME/sdk.


Thanks. I set the ANDROID_SDK_ROOT to that, but am still getting the same error. When I run “tns device”, I see there are still no connected devices. Do you actually have to connect a physical device to the computer to test it, or is it virtual? If so how can I connect the device? Thanks so much.


Emulator should be fine, you don’t need to connect a physical device. Did you start the emulator after setting the ANDROID_SDK_ROOT?


Yes I restarted Android Studio and the terminal. When I open Android Studio, I am getting the error message below and the error from before in the terminal. There are no errors in the event log after setting the ANDROID_SDK_ROOT.