Abi not recognized in Travis build

My Travis build keeps failing because apparently it does not recognize the abi

language: android
sudo: required

env:
  global:
  - ANDROID_API_LEVEL=28
  - ANDROID_BUILD_TOOLS_VERSION=28.0.3
  - ANDROID_ABI=armeabi-v7a
  - ANDROID_EMU_API_LEVEL=27

android:
  components:
    - tools
    - platform-tools
    - tools # appears twice as per Travis docs
    - build-tools-$ANDROID_BUILD_TOOLS_VERSION
    - android-$ANDROID_API_LEVEL
    - android-$ANDROID_EMU_API_LEVEL
    - extra-android-m2repository
    - sys-img-${ANDROID_ABI}-android-${ANDROID_EMU_API_LEVEL}
  licenses:
    - 'android-sdk-preview-license-52d11cd2'
    - 'android-sdk-license-.+'
    - 'google-gdk-license-.+'

before_cache:
  - rm -f  $HOME/.gradle/caches/modules-2/modules-2.lock
  - rm -fr $HOME/.gradle/caches/*/plugin-resolution/

cache:
  directories:
  - $HOME/.gradle/caches/
  - $HOME/.gradle/wrapper/
  - $HOME/.android/build-cache

before_script:
  - echo no | android create avd --force -n test -t android-$ANDROID_EMU_API_LEVEL --abi $ANDROID_ABI -c 100M
  - emulator -avd test -no-audio -no-window &
  - android-wait-for-emulator
  - adb shell input keyevent 82 &
  - chmod +x gradlew

script:
  - android list target
  - ./gradlew clean build
  - ./gradlew test
  - ./gradlew connectedCheck

I have also tried to change the abi in the emulator to google_apis no luck. Also tried to add google_apis in the system image download. I have currently tried API_LEVEL 22, 27 and 28. dont really understand the issue here to be honest… a bit frustrating

Hey @SolarUltima,

Your .travis.yml is really messy, that’s probably one reason, I’ve switched some things. I’ve isolated giving gradlew permission to run, as you can see via:

before_script:
  - chmod +x gradlew

You should also know sudo: required, doesn’t really need to be used anymore. It’s sunsetted. So there’s no reason to actually have that in your .travis.yml file.

In your Android project I also see ANDROID_ABI=armeabi-v7a, arm64-v8a or AArch64 has been available for quite some time now. I suggest you upgrade it.

This ABI is for ARMv8-A based CPUs, which support the 64-bit AArch64 architecture. It includes the Advanced SIMD like (Neon intrinsics), architecture extensions.

I’ll remind you that Clang defaults to the -ffixed-x18 option on Android, so unless you have a hand-written assembler (or extremely old compiler) you shouldn’t need to worry about this.

I cleaned up your .travis.yml that was pretty messy, with all I said above, try this and see if your project passes build:

language: android
jdk: oraclejdk8

env:
  global:
  - ANDROID_API_LEVEL=28
  - ANDROID_BUILD_TOOLS_VERSION=28.0.3
  - ANDROID_ABI=armeabi-v7a

android:
  components:
    - tools
    - platform-tools
    - tools
    - extra-android-m2repository
  licenses:
    - 'android-sdk-preview-license-52d11cd2'
    - 'android-sdk-license-.+'
    - 'google-gdk-license-.+'

before_install:
  - touch $HOME/.android/repositories.cfg
  - yes | sdkmanager "platforms;android-28"
  - yes | sdkmanager "build-tools;28.0.3"

before_cache:
  - rm -f  $HOME/.gradle/caches/modules-2/modules-2.lock
  - rm -fr $HOME/.gradle/caches/*/plugin-resolution/

cache:
  directories:
  - $HOME/.gradle/caches/
  - $HOME/.gradle/wrapper/
  - $HOME/.android/build-cache

before_script:
  - chmod +x gradlew

script:
  - ./gradlew clean build
  ​- ./gradlew test

I hope this helps, let me know what the final results are.

Montana Mendy
Travis CI Staff

1 Like

thank you @montana, that config did it!

Good to hear. If you run into anything else please post back.

Imprint