Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"ERROR : No emulator images (avds) found" running ionic on osx 10.10

This is the full error message I got after running ionic emulate android

*running cordova emulate android  
Running command: /Users/DeadLift/Documents/ionic/myApp/hooks/after_prepare/010_add_platform_class.js /Users/DeadLift/Documents/ionic/myApp
add to body class: platform-android  
Running command: /Users/DeadLift/Documents/ionic/myApp/platforms/android/cordova/run --emulator  
ANDROID_HOME=/usr/local/Cellar/android-sdk/24.1.2  
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home  
/Users/DeadLift/Documents/ionic/myApp/platforms/android/cordova  /node_modules/q/q.js:126  
                    throw e;  
                          ^
ERROR : No emulator images (avds) found.  
1. Download desired System Image by running: /usr/local/Cellar/android-sdk/24.1.2/bin/android sdk  
2. Create an AVD by running: /usr/local/Cellar/android-sdk/24.1.2/bin/android avd  
HINT: For a faster emulator, use an Intel System Image and install the HAXM device driver  
Error: /Users/DeadLift/Documents/ionic/myApp/platforms/android/cordova/run: Command failed with exit code 1  
    at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:131:23)  *emphasized text*
    at ChildProcess.emit (events.js:110:17)  
    at maybeClose (child_process.js:1015:16)  
    at Process.ChildProcess._handle.onexit (child_process.js:1087:5)*  

I follow all the above by creating an avd and it give me the same message again.
Thanks.

like image 581
MelvinFrohike42 Avatar asked May 01 '15 14:05

MelvinFrohike42


2 Answers

Vikas's answer is pretty spot on, however (sometimes) just running android avd won't work, which is what I found out after hours of trying to get it working.

When ever I ran android avd in my terminal it would give me the following error:

zsh: command not found: android

This is because I needed to add the Android SDK paths for the platform-tools and tools to my zshrc file (you might be running bash or something else on your terminal).

Simple fix was to add these files to my zshrc PATH environment, You can do this too by using your favourite text editor and depending on what shell you're using.

This link: http://docs.phonegap.com/en/2.8.0/guide_getting-started_android_index.md.html#Getting%20Started%20with%20Android helped me out a hell of a lot getting this fixed.

So I used subl ~/.zshrc (because sublime is my text editor and i've setup symlinks)

I Found my exports PATH and changed it to represent the following:

export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/dev/.rbenv/versions/2.2.3/bin/ruby:/Users/dev/Library/Android/sdk/platform-tools:/Users/dev/Library/Android/sdk/tools:$PATH"

I then saved the file, closed down sublime and ran source ~/.zshrc in my terminal window, and now I can run android avd and it now opens the Android Virtual Device Manager with no problems.

A reminder your shell might be different to mine (i.e. not running with zsh)and your exports PATH might look different as well, but it's pretty easy to figure out, and the link above will also help if you get stuck.

like image 85
ggomersall Avatar answered Nov 03 '22 06:11

ggomersall


Actually it is not able to find AVD (Android virtual device). You have to create one. Type "android avd" from Command Promt to use the graphical manager to setup an emulator image to work with for running your app on. The graphical tool is fairly straight forward to use.

like image 1
Vikas Garg Avatar answered Nov 03 '22 05:11

Vikas Garg