Android Travis CI错误:所选目标的--abi armeabi-v7a无效

时间:2019-01-29 16:15:35

标签: android arm travis-ci android-api-levels

我的Travis构建不断失败,因为它显然无法识别arm abi。这是我完整的.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

我还尝试将模拟器中的abi更改为google_apis/armeabi-v7a无济于事。还尝试在系统映像下载中添加google_apis。我目前已经尝试过API_LEVEL 22、27和28。 这是什么问题?

2 个答案:

答案 0 :(得分:1)

您可以尝试使用ANDROID_ABI=arm64-v8a代替ANDROID_ABI=armeabi-v7a

答案 1 :(得分:0)

我不知道这是否仍然有意义,因为它是4个月前问到的,但我最近也遇到了同样的问题。我尝试了人们建议的许多不同方法,但直到我以这种方式进行设置后,这些方法都没有起作用:

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