Fawwaz Yusran
Fawwaz Yusran

Reputation: 1480

Android Travis CI Error: Invalid --abi armeabi-v7a for the selected target

My Travis build keeps failing because apparently it does not recognize the arm abi. Here's my full .travis.yml:

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/armeabi-v7a to no avail. Also tried to add google_apis in the system image download. I have currently tried API_LEVEL 22, 27 and 28. What is the issue here?

Upvotes: 1

Views: 1007

Answers (2)

Justin Bee
Justin Bee

Reputation: 31

I don't know if this is still relevant since it was asked 4 months ago, but I also just recently had this same issue. I tried many different things people suggested and none of it worked till I set it up this way:

language: android
sudo: required
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

Upvotes: 1

SebSer
SebSer

Reputation: 194

You can try ANDROID_ABI=arm64-v8ainstead of ANDROID_ABI=armeabi-v7a

Upvotes: 1

Related Questions