Random thoughts & observations

From the mundane to the profound and everything in between here’s what’s rocking our world

Resolving Android Emulator errors on Mac OS X when using Ionic Framework

Posted: December 9, 2014
Written by: Saints At Play
Category: Ionic Framework

Developing an Android App on Mac OS X? Using the Ionic framework from the command line to trigger the Android Emulator? Seeing the following error returned?

ERROR Unable to load VM from snapshot

Thankfully the fix for this error is quite simple...

The Android Emulator relies on the use of an Android Virtual Device (AVD) being defined prior to using the emulator. An AVD is, as the name implies, a virtual representation of a real-world Android device such as a Galaxy S4 or Nexus 5 for example.

To define an AVD, or access an existing AVD, simply fire up your command line and type out the following to run the Android SDK Manager:

android

You should see a screen that resembles something akin to the following:

Android SDK Manager screen

Click on to the Tools menu and select the Manage AVDs... option.

If you have an existing AVD defined they will be listed in the Android Virtual device (AVD) Manager window that appears:

List of existing AVD's

The simplest and safest solution to resolving the emulator error listed at the beginning of the article would be to delete and recreate the AVD listed there.

Existing AVD's can become corrupted/unusable for any of the following potential reasons:

  • If the Android SDK has been updated, via the Android SDK Manager
  • If the AVD configuration has been edited

So really it's best to just remove those existing AVD's:

Confirm deletion of Android AVD

Once deleted you'll receive an additional confirmation message:

Deletion of Android AVD confirmed

Then re-create them by clicking on the Create button from the left-hand side of the window. This allows you to configure which type of device you want to replicate along with the desired hardware/storage specification:

Create a new AVD

Once the AVD has been re-created and saved you can then run the following from the command line:

ionic emulate android

And, all things being well, you should see the Android emulator being launched shortly afterwards.

« Return to Posts

Comments

Gravatar
Nba戰績

January 13, 2015

Nice Blog, thanks for sharing this kind of information.

Posting comments after three months has been disabled.