nativescript-cli icon indicating copy to clipboard operation
nativescript-cli copied to clipboard

Could not find an emulator image to run your project

Open EduardoAzul opened this issue 11 years ago • 17 comments

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

EduardoAzul avatar Mar 21 '15 18:03 EduardoAzul

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

flowforever avatar Mar 22 '15 14:03 flowforever

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

rosen-vladimirov avatar Mar 23 '15 07:03 rosen-vladimirov

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

teobugslayer avatar Mar 23 '15 09:03 teobugslayer

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

brianchirls avatar Mar 23 '15 14:03 brianchirls

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!

EduardoAzul avatar Mar 23 '15 18:03 EduardoAzul

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 avatar Mar 23 '15 22:03 rosen-vladimirov

@rosen-vladimirov Hell damn right!

tns run android --emulator --avd Nexus_5_API_21_x86

Thanks Guys! ^_^

capturar

EduardoAzul avatar Mar 24 '15 01:03 EduardoAzul

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.

brianchirls avatar Mar 24 '15 14:03 brianchirls

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.

rosen-vladimirov avatar Mar 24 '15 14:03 rosen-vladimirov

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 avatar Mar 24 '15 14:03 brianchirls

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

dkarlovi avatar Jan 06 '16 10:01 dkarlovi

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

latinbox avatar Jun 08 '16 18:06 latinbox

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.

latinbox avatar Jun 08 '16 18:06 latinbox

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.

yadinesh avatar Jun 25 '16 16:06 yadinesh

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

ILHAMIDEAZ avatar Sep 22 '16 15:09 ILHAMIDEAZ

$ 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

ishandutta2007 avatar Apr 17 '17 05:04 ishandutta2007

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!

pkoleva avatar Apr 20 '17 07:04 pkoleva