I give up!

After spent 3 days and more than 80 builds/trials/configurations/searches of an Android emulator on both versions 1 and 2. I give up.
Looks like there is no way at the moment or any simple configuration that loads the emulator.
Lack of memory and other issues happening.

Is it worth giving some details (or even better a GitHub repo) of your best attempt? Someone may have some information that you don’t, but if they can’t see what you’ve tried that didn’t work, readers have nothing to go on.

I’m running a pretty simple Android test suite complete with an emulator in Circle 2.0. Could you post your config file? I might be able to help if I see what you’re trying to do.

1 Like

hey @brandonschabell, could you please share your config file?

I’m trying to run a very simple Android test suite and every time I try to launch the emulator I’m getting that:

export LD_LIBRARY_PATH=${ANDROID_HOME}/emulator/lib64:${ANDROID_HOME}/emulator/lib64/qt/lib && sdkmanager --update && emulator64-arm -avd test -noaudio -no-boot-anim -no-window -accel on
[=======================================] 100% Computing updates...             

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"

So when I try to run my tests (next step) it fails:

	com.android.builder.testing.api.DeviceException: com.android.ddmlib.InstallException: Unknown failure (Error: Could not access the Package Manager.  Is the system running?)
		at com.android.builder.testing.ConnectedDevice.installPackage(ConnectedDevice.java:128)
[no message defined]
java.lang.RuntimeException: com.android.builder.testing.api.DeviceException: com.android.ddmlib.InstallException: Unknown failure (Error: Could not access the Package Manager.  Is the system running?)
	at java.util.concurrent.ForkJoinTask$AdaptedCallable.exec(ForkJoinTask.java:1431)
	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
	at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
	at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
	at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
Caused by: com.android.builder.testing.api.DeviceException: com.android.ddmlib.InstallException: Unknown failure (Error: Could not access the Package Manager.  Is the system running?)
	at com.android.builder.testing.ConnectedDevice.installPackage(ConnectedDevice.java:128)
	at com.android.builder.internal.testing.SimpleTestCallable.call(SimpleTestCallable.java:126)
	at com.android.builder.internal.testing.SimpleTestCallable.call(SimpleTestCallable.java:52)
	at java.util.concurrent.ForkJoinTask$AdaptedCallable.exec(ForkJoinTask.java:1424)
	... 4 more
Caused by: com.android.ddmlib.InstallException: Unknown failure (Error: Could not access the Package Manager.  Is the system running?)
	at com.android.ddmlib.Device.installRemotePackage(Device.java:1004)
	at com.android.ddmlib.Device.installPackage(Device.java:911)
	at com.android.builder.testing.ConnectedDevice.installPackage(ConnectedDevice.java:122)
	... 7 more
:app:connectedMobileDebugAndroidTest FAILED

I even tried to update the sdkmanager morethan once… before creating the emulator and before launching the emulator…

This is my test config (I’ve omitted some alias because they are just details):

 run_espresso_tests:
    <<: *defaults
    enviroment:
      _JAVA_OPTIONS: -Xms1024m -Xmx1536m -XX:MaxMetaspaceSize=1536m
    working_directory: ~/app-dir
    steps:
      - restore_cache: *restore_project_tests_key
      - restore_cache: *restore_gradle_cache_key
      - run:
          name: Updating SDK Manager
          command: sdkmanager --update
      - run:
          name: Setup Emulator
          command: sdkmanager "system-images;android-25;google_apis;armeabi-v7a" && echo "no" | avdmanager create avd -n test -k "system-images;android-25;google_apis;armeabi-v7a"
      - run:
          name: Launch Emulator
          command: export LD_LIBRARY_PATH=${ANDROID_HOME}/emulator/lib64:${ANDROID_HOME}/emulator/lib64/qt/lib && sdkmanager --update && emulator64-arm -avd test -noaudio -no-boot-anim -no-window -accel on
          background: true
          parallel: true
      - run:
          name: Run Espresso Tests
          command: ./gradlew connectedMobileDebugAndroidTest
      - store_test_results: *store_test_paths
2 Likes