2
votes

I'm trying to run android emulator with the command tns run android. This starts the emulator but it keeps stuck on Android logo and I get the following error:

(...)

BUILD SUCCESSFUL

Total time: 17.013 secs
Project successfully built.
Using C:\(...)\sample-Groceries\platforms\android\build\outputs\apk\sampleGroceries-debug.apk
Starting Android emulator with image Nexus6
Waiting for emulator device initialization..............

Cannot run your app in the native emulator. Increase the timeout of the operation with the --timeout option or try to restart your adb server with 'adb kill-server' command. Alternatively, run the Android Virtual Device manager and increase the allocated RAM for the virtual device. (...)

Here is my Android Virtual Device configured:

AVD Manager

enter image description here

Note: I can run the application on my phone anyway, but not on my PC.

5

5 Answers

3
votes

Finally I found the problem.

In Android Virtual Device Manager, there was an error I didn't see:

AVD Manager error

1
votes

Here is a solution which I found to be useful. enter image description here

You just have to manually activate the emulator, which you can do using android studio or command line. Using the command line, you have to run this command

emulator -avd avd_name [ {-option [value]} … ]

for ex:

/Android/sdk/emulator/emulator -avd test

Once the emulator starts you can run this command

tns run android
0
votes

I started having similar issue after updating to the latest Android Studio and latest emulators. I switched the VM Heap to 64, and it worked for me. May be worth giving that a try.

0
votes

Open your Android Virtual Device Manager and download the latest emulator. That will fix the error.

0
votes

I had the same problem. I fixed that by:

  1. Open emulator manually from Android Studio (double-click on position in AVD Manager list)
  2. Run tns run android

Works for macOS Sierra.