Ionic 4: No emulator images (avds) found

51
May 18, 2019, at 4:00 PM

I'm trying to emulate my ionic 4 app into Android Emulator so I run the command:

sudo ionic cordova emulate android --prod 

I get this error:

BUILD SUCCESSFUL in 1s
42 actionable tasks: 42 up-to-date
Built the following apk(s): 
    /Users/esham/Desktop/magazine-app/platforms/android/app/build/outputs/apk/debug/app-debug.apk
Checking Java JDK and Android SDK versions
ANDROID_SDK_ROOT=undefined (recommended setting)
ANDROID_HOME=/Users/esham/Library/Android/sdk (DEPRECATED)
No emulator images (avds) found.
1. Download desired System Image by running: /Users/esham/Library/Android/sdk/tools/android sdk
2. Create an AVD by running: /Users/esham/Library/Android/sdk/tools/android avd
HINT: For a faster emulator, use an Intel System Image and install the HAXM device driver
[ERROR] An error occurred while running subprocess cordova.
        cordova emulate android exited with exit code 1.
        Re-running this command with the --verbose flag may provide more information.
But I have 3 ADV on ADV Manager!!

And I could run any one of them by terminal for examble emulator @Pixel_2_API_26

These the list of ADV I have: emulator -list-avds

Pixel_2_API_26

Pixel_2_API_28

Pixel_3_API_28

When I'm running command android list avd getting:

The following Android Virtual Devices could not be loaded:
    Name: Pixel_3_API_28
    Path: /Users/esham/.android/avd/Pixel_3_API_28.avd
   Error: Google pixel_3 no longer exists as a device
---------
    Name: Pixel_2_API_26
    Path: /Users/esham/.android/avd/Pixel_2_API_26.avd
   Error: Google pixel_2 no longer exists as a device
---------
    Name: Pixel_2_API_28
    Path: /Users/esham/.android/avd/Pixel_2_API_28_1.avd
   Error: Google pixel_2 no longer exists as a device
So it doesn't make any sense! I have 3 ADV with all supported levels by cordova and keep saying No emulator images (avds) found.

These my environment setup on macOS:

export ANDROID_SDK=$HOME/Library/Android/sdk
export PATH=$ANDROID_SDK/emulator:$ANDROID_SDK/tools:$PATH
export ANDROID_HOME="$HOME/Library/Android/sdk"
export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/tools/bin
export PATH=$PATH/:$ANDROID_HOME/platform-tools
Answer 1

If you run "ionic cordova run android" it's automatic run emulate by default. so try this. I hope it fixed your issue. firstly you check you Emulated Android path and it is properly downloaded or not. You run "ionic cordova resources" it checks all resources if fine or not. You need to be install anything or not. so try this.

READ ALSO
Do you know any frontend formula creator component to use in html app? [on hold]

Do you know any frontend formula creator component to use in html app? [on hold]

We are building financial single page application using angularWe need to build a UI for user to create formula like how we do in excel

46
X-editable Yii2 : Uncaught TypeError: Cannot read property 'substr' of null

X-editable Yii2 : Uncaught TypeError: Cannot read property 'substr' of null

I'm using Yii2 dosamigos X-editable widget based on vitalet X-editableI'm using bootstrap 4

45
ipcMain listener not registering correctly

ipcMain listener not registering correctly

Am having some troubles with ipc messages between the main and renderer processes in an electron app

29
Unable to post the data from view to controller in Yii2

Unable to post the data from view to controller in Yii2

I am working on Yii2I have a gridview with checkbox and on a button click I am redirecting it to an action controller using ajax

45