Nativescript-cli: Could not find an emulator image to run your project

Created on 21 Mar 2015  路  17Comments  路  Source: NativeScript/nativescript-cli

Hey there,

i'm getting this error when i try to run with emulator tns run android --emulator, i'm using ionic and it runs all my apps in the emulator, it should work for nativescript either, anyone had this error before?

Thanks.

capturar

All 17 comments

I have met this issue, After I install the Android SDK everything goes well.

Hi @EduardoAzul
Have you added platform-tools and tools directories from your Android SDK to your PATH environment variable? Also you can try starting your AVD Manager and see if there's an image which targets at least Android 4.2.2 (the minimum supported API Level is 17).
If all of these requirements are met, can you try

$ tns run android --emulator --log trace

and send us the output. It will be great if you can send the output of

$ adb version

Hello @EduardoAzul, are you using Google API images? For the beta release, we support only pure android images. Of course, we accept pull requests :)

I'm having the same problem. The android tools and platform-tools directories are both in my PATH. (The android sdk folder is under ~/Library/Android) I've got images for API 21, 19 and 17.

The output of adb version is:

Android Debug Bridge version 1.0.32

The output of tns run android --emulator --log trace is here:
https://gist.github.com/brianchirls/2b497a0561763030e774

Hey guys, thanks for the support :)

@rosen-vladimirov I have the platform-tools and tools directories in path variable, and all API Levels after 17

The output of _adb version_ is:

_Android Debug Bridge version 1.0.32_

And here is the output of the _tns run android --emulator --log trace_

https://gist.github.com/EduardoAzul/c480c5cb33cd10fa38fd

@teobugslayer

I dont't really know if i'm using Google API images, but i don't think so, i just installed android SDK and android studio. I can even use ionic which is out of the Android Studio and the emulator to run some apps.

Thanks!

Hi @EduardoAzul , @brianchirls
Thanks for the information you've both shared. As @teobugslayer pointed, currently nativescript-cli can handle only native android images, when you do not select image on your own. Can you try
tns run android --emulator --avd <image name>
and replace <image name> with the name of one of your images listed when you start AVD Manager. Can you check if this works for you?

@rosen-vladimirov Hell damn right!

tns run android --emulator --avd Nexus_5_API_21_x86

Thanks Guys! ^_^

capturar

It worked for me too. And after running it once specifying image, it works just fine without it and just defaults to that image. Strange.

Also, when I accidentally mis-type the image name, it does not seem to notice that the image name I gave it doesn't exist and hangs indefinitely.

Hey guys, I'm happy the emulator is finally started.

@brianchirls
It is really strange that is started working without passing avd. Our code is checking some of the images configuration files and maybe after the first start, they were successfully created and the next time we are able to read the required information.
As per the incorrect image name, we have it in our backlog https://github.com/NativeScript/nativescript-cli/issues/289.
As the issue seems resolved I intend to close it by the end of the day. Please inform me in case you have any concerns.

Thanks, @rosen-vladimirov. My only concern is that this step should probably be added to the documentation if it can't be fixed, before the issue is closed.

@brianchirls @rosen-vladimirov :+1: on adding this to documentation, had the same issue which got fixed by the same solution.

thanks a lot for the solution @rosen-vladimirov i had the same issue as @EduardoAzul

oh shit i got this one after putting tns run android --emulator --avd Nexus_5_API_21_x86:
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.

I am able to launch the emulator on Windows 7 using the command tns run android --emulator --avd Nexus_5_API_21_x86 but my app is not appearing on the emulator. Please suggest.

Hi, I'm also facing the same issue -
My PATH :
C:\Program Files\Java\jdk1.8.0_102\bin;C:\Users\IlhamideaZ\AppData\Local\Android\android-sdk

tns run android --emulator --log trace
w1

adb version
w2

How can I solve it? Thanks!

@rosen-vladimirov

$ tns run android --emulator --log trace

execFile: /Users/ishandutta2007/Library/Android/sdk/platform-tools/adb "help"
execFile: /Users/ishandutta2007/Library/Android/sdk/platform-tools/adb "help"
Exec uname -a
stdout: Darwin MacBook-Pro 16.5.0 Darwin Kernel Version 16.5.0: Fri Mar 3 16:52:33 PST 2017; root:xnu-3789.51.2~3/RELEASE_X86_64 x86_64

stderr:
Exec npm -v
stdout: 4.1.2

stderr:
spawn: java "-version"
Exec node-gyp -v
stdout:
stderr: /bin/sh: node-gyp: command not found

Exec xcodebuild -version
stdout: Xcode 8.2.1
Build version 8C1002

stderr:
Exec gem which xcodeproj
stdout: /Library/Ruby/Gems/2.0.0/gems/xcodeproj-1.4.4/lib/xcodeproj.rb

stderr:
Exec pod --version
stdout: 1.2.1

stderr:
Exec '/Users/ishandutta2007/Library/Android/sdk/platform-tools/adb' version
stdout: Android Debug Bridge version 1.0.39
Revision 5943271ace17-android

stderr:
spawn: /Users/ishandutta2007/Library/Android/sdk/emulator/emulator "-help"

$ adb version

Android Debug Bridge version 1.0.39
Revision 5943271ace17-android

Hey, @ILHAMIDEAZ @ishandutta2007 can you verify you have created emulator images with either tns devices android --available-devices (in case you are using our RC) or using android command-line emulator -list-avds .
Thanks!

Was this page helpful?
0 / 5 - 0 ratings