How to setup an emulator running API 25 using a build matrix on Travis CI? How to setup an emulator running API 25 using a build matrix on Travis CI? android android

How to setup an emulator running API 25 using a build matrix on Travis CI?


Note: emulator version 26.1.4+ versions can introduce or fix bugs. If a reproducible ci build is required, the best option is to download the desired sdk-tools version no via android components.

Note: emulator version 26.1.3 is here including interesting fixes. I'm busy to revise my answer now:

enter image description here

Related issue using emulator 26.1.2 here. Relaunch last build like me to use 26.1.3 and pray, green

I am attempting to setup Travis CI so that it runs instrumentation tests on an emulator running API 25. Travis runs the tests to completion on API 4/10/19, but fails to startup the emulator for API 25...

How can I fix this so that the API 25 emulator launches and runs the tests?

Update: I confirmed that ARM ABIs for APIs 23, 25 and 26 are also missing in Android Studio, so:

  • It's not a Travis-ci issue. I reproduced it locally as shown in the next image.

  • You can use ARM ABI for API-24. I forked your project and it worked in build #6 (next image).

  • You can use Google APIs image for API-25 as I explain below using the new sdkmanager: 1

  • You can use Google APIs image for API-25 using legacy tools if you know the img name: 1,2,3

  • We need to ask to Google or someone else why the ARM ABIs for these APIs are missing.

Update: A related bug was already reported to Google and discussed here, please, star it:

For some reason it's marked as being only available on windows. I'm not sure if this is a problem with ADRT itself or the configuration for this package, but from a quick look it seems like it's probably a problem with adrt itself.

enter image description here

enter image description here


I'm not sure if the api-25 issue is related but I expect that it will work combining several solutions:

  • Use system images with google_apis to simplify the build matrix and avoid missing ABIs.
  • Use the new sdkmanager and avdmanager required by the recent Sdk Tools.
  • Use the new Trusty images including these tools to simplify the Travis-ci configuration or alternatively use dist: precise as explained here.

See the links below to working samples using a build matrix that includes Api-25 emulator.


I updated the api 23 system image one time on a macbook via Android Studio and appeared a message about the new version was not supported by my computer, so I use the google_apis one.

I offer a possible solution to the issue commented by Ashish Pathak (I'm also ardock) here.

I need to update my response to support the new Travis-ci images that comes with new SDK tools.

The new pre-installed Sdk Tools will simplify the solution and reduce the YAML file in size.


As announced in this blog post by Carmen Andoh and Dominic Jodoin on 19 Jun 2017:

Updates are coming to all Ubuntu Trusty 14.04 images

This new generation of Trusty images is already available in production and can be used by adding group: edge in your .travis.yml file:

sudo: requireddist: trustygroup: edge  # Add this

And as explained here:

As a bit more information, this new Android image comes with:

Android SDK 25.2.3 build-tools-25.0.2

The new sdkmanager tool - a command line tool that allows you to view, install, update, and uninstall packages for the Android SDK. Replaces the previous android tool, see https://developer.android.com/studio/tools/help/android.html

Also, the new Android image should be retro-compatible. See the full list of Android SDK components that can be specified in the .travis.yml file, including build-tools-26.0.0-preview.

But they are not using the new avdmanager, I'll try to fix it this weekend.

Alternatively, you can use the previous images by adding dist: precise.


The lines below are part of my answer on a related question: prior to the images update:

Full working sample using constraint-layout codelab repository for Android API level 22 to 25:

Two more samples using sdkmanager and avdmanager:

References

Official documentation related to Auto-download missing packages with Gradle

The new Emulator options are explained in Start the Emulator from the Command Line

avdmanager explained here replaces android avd since SDK tools version 25.3.0

sdkmanager explained here also enhanced to view and accept all licenses from the command line