10

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?

Josh Justice
  • 21,186
  • 3
  • 25
  • 20
  • It seems there are more people having this problem lately. It occurs to me that it's a new bug, happening perhaps only in Android Studio 3.5 or maybe in a recent version of the Android Tools. Related: https://stackoverflow.com/questions/57683979/emulator-cannot-find-ram-img-on-ubuntu – xarlymg89 Sep 20 '19 at 09:25
  • Same issue with Android Studio 3.6 Preview Canary 12. – xarlymg89 Sep 20 '19 at 09:32
  • Rereading your question, now I understand it's quite clear that it has nothing to do with Android Studio. Basically because you aren't using it. So it should have something to do with the Android SDK Tools (I think they are the ones that have the avdmanager in it). – xarlymg89 Sep 20 '19 at 12:33
  • I reported the bug some days ago, maybe you can add more info https://issuetracker.google.com/issues/141255618 – Salvador Moreno Sep 21 '19 at 09:47

0 Answers0