Apparently the names of the Google APIs system images and ABI parameters changed:
- ABI =
armeabi-v7a
to google_apis/armeabi-v7a
- System image =
sys-img-armeabi-v7a-android-21
to sys-img-armeabi-v7a-addon-google_apis-google-21
I fixed this by updating both my ANDROID_ABI
variable and component name for the system image - new values are:
- ANDROID_ABI=google_apis/armeabi-v7a
...
# Specify at least one system image,
- sys-img-armeabi-v7a-addon-google_apis-google-$ANDROID_API_LEVEL
Here's the whole section in context:
env:
global:
- ANDROID_API_LEVEL=21
- ANDROID_BUILD_TOOLS_VERSION=21.1.2
- ANDROID_ABI=google_apis/armeabi-v7a
android:
components:
- platform-tools
- tools
- build-tools-$ANDROID_BUILD_TOOLS_VERSION
- android-$ANDROID_API_LEVEL
# For Google Maps API v1
- addon-google_apis-google-$ANDROID_API_LEVEL
# Google Play Services
- extra-google-google_play_services
# Support library
- extra-android-support
# Latest artifacts in local repository
- extra-google-m2repository
- extra-android-m2repository
# Specify at least one system image
- sys-img-armeabi-v7a-addon-google_apis-google-$ANDROID_API_LEVEL
After these changes, it builds successfully.
EDIT Sept 12th, 2016
Apparently there was another change in mid-2016 that causes this same problem. For example, here's a failed build with the same error message.
The following changes were needed to fix Travis builds:
- Add separate
ANDOID_TAG ABI
tag variable
- Duplicate tools to get the new
repository-11.xml
and to install Android SDK tools 25.1.x
- Change system image names to match new Android SDK
- Change emulator start command to use new ABI tag variable to specify Google APIs
For example:
- ANDROID_ABI=google_apis/armeabi-v7a
...changed to:
- ANDROID_ABI=armeabi-v7a
- ANDROID_TAG=google_apis
- tools
needs to be listed twice.
The system images:
- sys-img-armeabi-v7a-addon-google_apis-google-23
- sys-img-armeabi-v7a-addon-google_apis-google-23
...needed to be changed to:
- sys-img-armeabi-v7a-google_apis-23
- sys-img-armeabi-v7a-google_apis-23
The line to start the emulator changed from:
- echo no | android create avd --force -n test -t "Google Inc.:Google APIs:23" --abi $ANDROID_ABI
...to:
- echo no | android create avd --force -n test -t "android-23" --abi $ANDROID_ABI --tag $ANDROID_TAG
See this commit for a changeset of what needs to be changed, this file for a fully working script, and see https://github.com/travis-ci/travis-ci/issues/6122#issuecomment-239073557 for details.
Thanks to @Ardock for the fixes!
EDIT Nov 28th, 2016
I seems that API Level 23 emulator is currently not working on Travis with the above - android create avd --force -n test -t "android-23" --abi "armeabi-v7a" --tag "google_apis"
yields the error Error: Invalid --tag google_apis for the selected target.
For more details see https://github.com/OneBusAway/onebusaway-android/issues/720.
Also, apparently ARM ABIs aren't currently available for API Level 24 or 25 (Android 7.1.1) - see this issue for a screenshot of SDK Manager.
Posted issue to Android Studio Google+ Community here:
https://plus.google.com/+SeanBarbeau/posts/adNGGtJFhvi?sfc=true