7
votes

I am trying to run an android emulator on Linux mint.

When I try to run the avd , on the emulator, I get the following error.

emulator: ERROR: This AVD's configuration is missing a kernel file! Please ensure the file "kernel-ranchu" is in the same location as your system image.
emulator: ERROR: ANDROID_SDK_ROOT is undefined

When I navigate to android_sdk/system-images/android-21/default/armeabi-v7a

There exists a kernel file called kernel-qemu

I guess there is some sort of compatibility issue between the emulator and my avd?

Is there a way to resolve this?

Below is the script I use to install my android tools, and create the avd...

# use sdkmanager to install all the tools 
SDKGET=~/android_sdk/tools/bin/sdkmanager 
$SDKGET "build-tools;29.0.2" 
$SDKGET "emulator" 
$SDKGET "platform-tools" 
$SDKGET "platforms;android-21" 
$SDKGET "platforms;android-24" 
$SDKGET "system-images;android-21;default;armeabi-v7a" # lollipop 5.0
$SDKGET "system-images;android-24;default;armeabi-v7a" # Nougat 7.0
$SDKGET "system-images;android-26;default;x86" # Orea 8.0

# use avdmanager to create the virtual devices
AVDMAKE=~/android_sdk/tools/bin/avdmanager 
$AVDMAKE create avd -n Nexus4_5.0_api21 -k "system-images;android-21;default;armeabi-v7a" --device "Nexus 4" # 1280X768
$AVDMAKE create avd -n Nexus5_7.0_api24 -k "system-images;android-24;default;armeabi-v7a" --device "Nexus 5" # 1920 x 1080
$AVDMAKE create avd -n Nexus6P_8.0_api26 -k "system-images;android-26;default;x86" --device "Nexus 6P" # 2560 x 1440
2
i have the same problem did you find a solutionYellown

2 Answers

0
votes

My solution to this was just to use the android-24 and android-26 system images. They worked when the android-21 did not.

0
votes

Try using an older version of the Android Build Tools, if possible. Something like "build-tools;28.0.3" or "build-tools;27.0.3"

Someone here -- https://github.com/mingchen/docker-android-build-box/issues/38 -- said that the problem could be caused by the files in the Android-SDK/emulator/ folder not working correctly, when the newer versions of the Build Tools are installed.

I don't know if there's a way to downgrade the files in Android-SDK/emulator/, but you can copy the folder from an old installation and replace it in your new installation. And you should check for a file named emulator64-arm, and check the source.properties to see what build tools version it refers to.