由于许可证问题,Travis android构建失败

时间:2017-11-01 12:49:37

标签: android react-native travis-ci

travis android build失败,出现以下异常

您尚未接受以下SDK组件的许可协议: [Android SDK Build-Tools 25.0.3]。 在构建项目之前,您需要接受许可协议并使用Android Studio SDK Manager完成缺少的组件的安装。 或者,要了解如何将许可协议从一个工作站转移到另一个工作站,请转至

travis android配置:

language: android
  os: linux
  jdk: oraclejdk8
  before_cache:
    - rm -f  $HOME/.gradle/caches/modules-2/modules-2.lock
    - rm -fr $HOME/.gradle/caches/*/plugin-resolution/
  sudo: required
  node_js: false
  before_install:
    - nvm install 7
    - node --version
    - travis_retry curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
    - echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
    - travis_retry sudo apt-get update -qq
    - travis_retry sudo apt-get install -y -qq yarn
  install:
    - yarn
  android:
    components:
      - build-tools-25.0.3
      - android-25
      - extra-android-m2repository
      - extra-google-google_play_services
      - extra-google-m2repository
      - addon-google_apis-google-16
  script:
    - cd android
    - bundle install
    - bundle exec fastlane deploy

1 个答案:

答案 0 :(得分:1)

android:块下添加:

licenses:
  - android-sdk-preview-license-.+
  - android-sdk-license-.+
  - google-gdk-license-.+