I just got done installing Android studio and trying to take it for a test run. When I try to run my app I get the following error message
emulator: ERROR:
Hey there just ran into the same issue you did, the 3rd link down in google brought me to this bit of code that throws the error,
if (kernelFile == NULL) {
kernelFile = avdInfo_getKernelPath(avd);
if (kernelFile == NULL) {
derror( "This AVD's 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 person wrote:
"/* If the kernel image name ends in "-armv7", then change the cpu * type automatically. This is a poor man's approach to configuration * management, but should allow us to get past building ARMv7 * system images with dex preopt pass"
So I went back in and downloaded the x86 intel atom version for my desired API level and was able to get the emulator up without the error. Hope it helps you too.....
A common approach to follow to solve this problem.
1.CHECK your SDK manager by running from your android studio and stand alons sdk folder by executing ./android.sh
helps you to find broken packages
Try installing System emulator images with google API support than the Intel one. Just like , i solved my problem by running into another system image.
Experment on KVM based Virtulaization suggested by Google for Linux
I had the same error. The solution for me was change the ANDROID_HOME path. First I took a look into tools->android->sdk manager from Android Studio. In that window, we can see the path where Android Studio looks for the SDK: image
Then I opened a Windows CMD shell, executed:
echo %ANDROID_HOME%
but the path was different to the one in ANDROID STUDIO CONFIGURATION of the first step.
The solution was to change in user environment, the ANDROID_HOME, to the one of the first step: image
I finally closed the cmd shell, and opened another cmd shell to execute:
echo %ANDROID_HOME%
the path was updated, and I could run my emulator perfectly.
Go to Tools | Android | AVD Manager
Click the arrow under the Actions column on far right (where error message is)
Choose Edit
Leave the default selection (For me, MNC x86 Android M)
Click Next
Click Finish
It saves your AVD and error is now gone from last column. And emulator works fine now.
In my case (Windows 10) the reason was that I dared to unzip the android sdk into non default folder. When I moved it to the default one c:/Users/[username]/AppData/Local/Android/Sdk and changed the paths in Android Studio and System Variables, it started to work.
I got it fixed by running "C:\Program Files\Android\android-sdk\AVD Manager.exe" and repairing my broken device.