Cannot start emulator in Android Studio

I just finished installing the Android studio and tried to get it for a trial run. When I try to start my application, I get the following error message

emulator: ERROR: This AVD configuration is missing a kernel file!! emulator: ERROR: ANDROID_SDK_ROOT is undefined 

Does anyone know how to fix this?

+75
android android-emulator android-studio
Mar 04 '15 at 20:57
source share
11 answers

Perhaps you really do not have system images. Double check that $ANDROID_HOME/system-images/android-<YOUR DESIRED API>/armeabi-v7a exists and is not empty. If they are really missing - install / reinstall using the SDK manager.

+22
Mar 26 '15 at 16:06
source share

Go to Tools | Android | AVD Manager

Click the arrow in the "Actions" column on the right (where the error message appears)

Select "Edit."

Leave the default selection (for me, MNC x86 Android M)

Click "Next"

Click Finish

This saves your AVD, and now the error has disappeared from the last column. Now the emulator is working fine.

+15
Aug 6
source share

I fixed it by running "C: \ Program Files \ Android \ android-sdk \ AVD Manager.exe" and repairing the damaged device.

+10
May 14 '15 at 11:24
source share

Just fixed it. Hope this helps others. (Problem, as in Android v2 studio) This problem is intended for hand emulators. In this example, I am using armeabi-v7a 16 API

The fix consists of three steps:

Step 1: Open sdk manager and make sure you have installed ARM EABI v7a System Image

Step 2. This is an obvious case of adding the sdk location to system variables.

Right-click the โ€œThis PCโ€ icon on your desktop, then

Properties -> Advanced system settings -> Environment Variables... Then add the sdk path as new to the system variables section using the ANDROID_SDK_ROOT variable ANDROID_SDK_ROOT .

Step 3. Restart Android Studio to make case-sensitive changes. After fixing the ANDROID_SDK_ROOT problem is undefined, the emulator still cannot find the kernel files, even if it sees that the sdk manager installed it on

path-to-sdk\sdk\system-images\android-16\default\armeabi-v7a\kernel-qemu

The reason is the confusion between the location where the sdk manager installs the kernel file and the location that the emulator is looking for.

If you open your config.ini (Android Studio โ†’ AVD Mananger โ†’ "Show on Disk") for your emulator, you will see the following line:

image.sysdir.1=add-ons\addon-google_apis-google-16\images\armeabi-v7a\

(ie \ path-to-sdk \ add-ons \ addon -....)

Instead of changing this value in the config.ini file, I copied

path-to-sdk\sdk\system-images\android-16\default\armeabi-v7a\kernel-qemu

(the kernel file from the sdk manager folder is installed)

to

\path-to-sdk\add-ons\addon-google_apis-google-16\images\armeabi-v7a\

And that was the missing kernel file. You can run the emulator. (You will need to close Android Studio and reopen it again). Give the emulator some time, as it is 10 times smaller compared to x86. (Mine took about 5 minutes to start)

+9
Jul 6 '16 at 9:50
source share

Short answer : try to create the same image using the old school <AndroidSDK>\AVD Manager.exe .

Working in Android Studio, using all the integrated tools, it became natural for me not to use the old managers (AVD / SDK).

In my case, I had this problem when using the new (integrated) AVD Manager to create devices with old system images (API 11 and below, as I already tested).

When I tried to use the old AVD Manager tool (located in <AndroidSDK>\AVD Manager.exe ) to create these old device images, I was successful.

+5
Jun 22 '16 at 23:13
source share

Hi, I just ran into the same problem as you, the 3rd google link led me to this piece of code that throws an error,

 if (kernelFile == NULL) { kernelFile = avdInfo_getKernelPath(avd); if (kernelFile == NULL) { derror( "This AVD configuration is missing a kernel file!!" ); const char* sdkRootDir = getenv("ANDROID_SDK_ROOT"); if (sdkRootDir) { derror( "ANDROID_SDK_ROOT is defined (%s) but cannot find kernel file in " "%s" PATH_SEP "system-images" PATH_SEP " sub directories", sdkRootDir, sdkRootDir); } else { derror( "ANDROID_SDK_ROOT is undefined"); } exit(2); 

to which the man wrote:

"/ * If the kernel image name ends with" -armv7 ", then change the * type processor automatically. This is a bad approach to configuring * management, but should allow us to bypass the ARMv7 building * system images with dex preopt pass"

So, I came back and downloaded the intel x86 version of intel for my desired API level and was able to get the emulator without error. Hope this helps you too.

+3
Mar 16 '15 at 2:13
source share

Typically, an error occurs due to an inappropriate AVD emulator for the type of application for which you are developing. For example, if you are developing a wearing app, but you are trying to use a phone emulator to launch it.

+2
Oct 17 '15 at 21:04
source share

In my case (Windows 10), the reason was that I dared to unzip sdk android to the default folder. When I moved it by default, c: / Users / [username] / AppData / Local / Android / Sdk and changed the paths in Android Studio and system variables, it started working.

0
Apr 11 '17 at 6:12
source share

I had the same error. The solution for me changed the ANDROID_HOME path. First I looked at tools-> android-> sdk manager from Android Studio. In this window, we see the path along which Android Studio searches for the SDK: image

Then I opened the Windows CMD shell by doing:

 echo %ANDROID_HOME% 

but the path was different from the path in the ANROID STUDIO CONFIGURATION of the first step.

The solution was to change the ANDROID_HOME user environment to one of the first steps: image

I finally closed the cmd shell and opened another cmd command to execute:

 echo %ANDROID_HOME% 

the path was updated and I was able to fully start the emulator.

0
May 27 '17 at 10:18
source share
  • Open Android Studio.
  • Select Settings> System Preferences> Android SDK
  • Get the "Location Android SDK".
  • Set the ANDROID_SDK_ROOT environment variable to this value.

This worked for me and I am in Windows 10 and Android studio 2.3.3

0
Sep 09 '17 at 7:55
source share

A general approach to solving this problem.

1.READ your SDK manager by running android studio and standal sdk from your studio by running ./android.sh , you can find broken packages

  1. Try installing system emulator images that support Google APIs than Intel. Just like, I solved my problem by running another image of the system.

  2. KVM-based Virtulaization Experiment Offered by Google for Linux

-one
Oct 14 '15 at 7:49
source share



All Articles