Despite Google’s efforts to deprecate the Android SDK Manager standalone GUI in an attempt to force the installation of Android Studio -irrelevant for Cordova apps-, you can still run any Android emulator without Android Studio using the updated SDK Manager tools. This process involves installing the SDK tools 24 and then updating them to version 28.
- Your Android 8.x and 9.x system images (API 26 and newer) refuse to start.
- OR you want to use the latest Android SDK API level and emulators with Visual Studio (for Windows) instead of its obsolete built-in SDK
- OR you receive any of these errors on emulator startup:
ERROR: This AVD’s configuration is missing a kernel file! Please ensure the “kernel-qemu” is in the same location as your system image.
ERROR: ANDROID_SDK_ROOK is undefined
“To Start Android, enter your password” dialog on startup followed by “Decryption Unsuccessful” message
Starting from API 26 (Android 8.0.0) and onwards, system images are incompatible with the aging Android SDK tools version 24 and will throw all kind of startup errors or refuse to run.
If you have already updated the Android SDK tools to version 27 or newer and still get emulator related errors, please keep reading to ensure your emulators have been setup properly and according to your hardware.
If you are using Visual Studio 2015 or 2017 with Tools for Apache Cordova and want to use the latest SDK instead of using the obsolete API25 and emulators provided by Visual Studio, set your ADT_HOME path to the location where you have installed the SDK using the following instructions. This path can be set in Tools > Options > Tools for Apache Cordova.
Update your Android SDK Emulator
Update your Android SDK emulator to version 27 or newer. Do not use the SDK tools from
Android Developers downloads, these won’t work with the SDK GUI tools, as they are all command line executables only.
- If you don’t have Android SDK tools 24.4.1 already, download and install it. This is the last version that features the standalone SDK Manager and AVD Manager GUI apps, before the release of Android Studio.
- Windows: android-sdk_r24.4.1-windows.zip
- Installer version: installer_r24.4.1-windows.exe
- MacOS: android-sdk_r24.4.1-macosx.zip
- Linux: android-sdk_r24.4.1-linux.tgz
- Windows: android-sdk_r24.4.1-windows.zip
- Get the updated Android SDK emulator 28.0.22 for your platform: (*)
- Windows: emulator-windows-5194135.zip
- MacOS: emulator-darwin-5194135.zip
- Linux: emulator-linux-5194135.zip
- Uninstall your current Android 8 and newer System Images.
- Close your Android SDK Manager and AVD Manager tools if open.
- Extract the contents from the ZIP file into your android-sdk/tools:
- Windows: The ZIP file contains an emulator folder, its contents must be copied over your current android-sdk/tools folder.
- MacOS: The ZIP contains an emulator folder that must be merged with your current android-sdk/tools folder.
- Launch SDK manager and check if the version in the About dialog is latest.
The emulator linked here was released on July 9, 2018. Check out the release notes for more info.
(*) Some links here have been taken from this StackOverflow post by the user xavier_fakerat, make sure to kindly upvote his answer there.
Download System Images and create Android emulator
After updating your SDK Manager, follow these steps to create your API26 or API27 emulators.
- Download the desired emulator’s System Images from the SDK Manager.
- Create a new emulator from the AVD Manager with these settings:
- Target: Android 8.1.0 or 9.x
- CPU/ABI: Google APIs Intel Atom. Using Google APIs system images instead of regular ones provides access to all Firebase and Google Play Services APIs and libraries.
- Activate Hardware keyboard present
- RAM: At least 1024 MB, VM Heap at least 256 MB.
Notices and Warnings
The higher the API level, the greater the emulator’s RAM requirements will be.
- Setting RAM too low will cause the emulator to either fail to start, or start but never end booting. Use at least 1024 or 2048 MB for API26 images.
- Setting RAM to a value higher than your system’s capacity will fail to start the emulator with these errors:
Failed to register RAM block: va=0x93340000, size=0x100000000, method=legacy
VCPU shutdown request
- Emulator’s first boot seems to require more RAM. If you create an emulator with 512 MB for the first time, it might never end booting and hang. If you create it with 2048 MB, start it up, then close it, you may be able to run it with as little as 512 MB from now on, to a certain extent. (All RAM values here refer to the AVD’s assigned RAM!)
If your emulator fails to start or strange Play Services errors popup randomly, try increasing RAM and VM heap values. With a physical 8GB of RAM you can easily assign 2048 MB if running Windows 8.1 or Windows 10, and still have plenty of RAM available for other applications. If you need to increase RAM to higher values and you get the Failed to register RAM block error, restart your computer and don’t open anything but the emulator first. If this still doesn’t work you’ll need to expand your physical RAM.
Requirements for Intel Processor Users
On Intel x86-based computers, the Android Emulator uses Intel HAXM by default. Intel HAXM is a mature and open-sourced hypervisor solution developed by Intel. Thanks to on-going development by Intel, the fastest emulator performance on Windows is still with Intel HAXM. To download the latest Intel HAXM, refer to the official guides at GitHub:
Requirements for AMD Processor Users
AMD processor users will need to pay attention to additional requirements and recommendations:
- AMD Processor – Recommended: AMD® Ryzen™ processors
- Android Emulator v27.3.8+ (linked on this page)
- x86 Android Virtual Device (AVD)
- Windows 10 with April 2018 Update
- Windows Hypervisor Platform enabled in Windows Features
After taking care of the above settings, you’ll be able to run API 26 and newer emulators on your AMD based computer with latest speed and resources usage improvements.
Reporting Bugs in the Android SDK tools
If you find an issue that impacts one of the Android Developer tools, such as Android Studio, SDK, Emulator, System Images, or Support Library, you can file a bug in one of these components.
Other issues with the Android emulator
If you have other problems emulating your Cordova apps, feel free to post your issue in full detail in the Comments section below. You may receive feedback from me or other fellow developers to help you with your particular case.
Resolution to common Cordova build errors
This article features some of the most common Cordova build-related errors and the solutions that have worked for me or that I found to be reliable. Please check it out and leave your comments there if you have other build problems or warnings.