I'm attempting to start an Android emulator on Jenkins CI, but the startup never completes. On CI the command is running in a Docker image based on ubuntu:18.04
. I'm using the following command to start the emulator:
/opt/android-sdk-linux/emulator/emulator -no-audio -no-window -delay-adb \
@Pixel_C_API_25 &
Then I wait for the emulator to complete with:
adb wait-for-device
On my developer machine (macOS 10.14.6), the emulator finishes starting and adb wait-for-device
returns, but on CI the emulator never finishes launching. The relevant portions of the log output are here:
Starting emulator
Waiting for emulator
* daemon not running; starting now at tcp:5037
statvfs('/home/ec2-user/.android/avd/Pixel_C_API_25.avd/snapshots/default_boot/ram.img') failed: No such file or directory
### WARNING: could not find /usr/share/zoneinfo/ directory. unable to determine host timezone
emulator: WARNING: encryption is off
Your emulator is out of date, please update by launching Android Studio:
- Start Android Studio
- Select menu "Tools > Android > SDK Manager"
- Click "SDK Tools" tab
- Check "Android Emulator" checkbox
- Click "OK"
* daemon started successfully
### WARNING: could not find /usr/share/zoneinfo/ directory. unable to determine host timezone
Sending interrupt signal to process
Terminated
script returned exit code 143
I think the "emulator is out of date" warning is a red herring, as it doesn't cause problems for me locally. I think the more likely problem is:
statvfs('/home/ec2-user/.android/avd/Pixel_C_API_25.avd/snapshots/default_boot/ram.img') failed: No such file or directory
But I haven't been able to find info on what would cause this problem or fix it. Locally the ram.img
file is present.
I've tried with AVDs based on the following system images. Previously there seemed to be an error with x86 not being supported on the x86-related images, but I'm no longer getting that error. Instead, all of them give the above ram.img
error:
system-images;android-25;google_apis;arm64-v8a
system-images;android-25;google_apis;armeabi-v7a
system-images;android-28;google_apis;x86_64
system-images;android-28;google_apis;x86
system-images;android-28;default;x86_64
In each case I create the AVD with commands analogous to the following:
sdkmanager --install "system-images;android-25;google_apis;armeabi-v7a"
avdmanager create avd --force --name Pixel_C_API_25 --abi google_apis/armeabi-v7a --package "system-images;android-25;google_apis;armeabi-v7a" --device "pixel_c"
Has anyone successfully gotten an Android emulator to start on Ubuntu 18, and if so, which system image did you use?