Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/blackberry/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Travis负责android许可证问题_Android_Continuous Integration_Travis Ci - Fatal编程技术网

Travis负责android许可证问题

Travis负责android许可证问题,android,continuous-integration,travis-ci,Android,Continuous Integration,Travis Ci,我正在尝试为我的一个项目实施CI,每当travis运行它时,都会出现以下错误: FAILURE: Build failed with an exception. * What went wrong: A problem occurred configuring project ':app'. > You have not accepted the license agreements of the following SDK components: [Android SDK Build

我正在尝试为我的一个项目实施CI,每当travis运行它时,都会出现以下错误:

FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':app'.
> You have not accepted the license agreements of the following SDK components:
  [Android SDK Build-Tools 25.0.1, Android SDK Platform 25].
  Before building your project, you need to accept the license agreements and complete the installation of the missing components using the Android Studio SDK Manager.
  Alternatively, to learn how to transfer the license agreements from one workstation to another, go to http://d.android.com/r/studio-ui/export-licenses.html
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
我经历过,还有其他一些,但我不知道我做错了什么

language: android
jdk:
  - oraclejdk8
sudo: true
before_install:
- chmod +x gradlew
env:
  global:
   - ANDROID_API_LEVEL=23
   - EMULATOR_API_LEVEL=21
   - ANDROID_BUILD_TOOLS_VERSION=23.0.1
   - ANDROID_ABI=armeabi-v7a
   - ANDROID_TAG=google_apis
   - ADB_INSTALL_TIMEOUT=8 # minutes (2 minutes by default)
android:
  components:
    - tools
    - tools
    - platform-tools
    - build-tools-$ANDROID_BUILD_TOOLS_VERSION
    - android-$ANDROID_API_LEVEL
    - android-$EMULATOR_API_LEVEL
    - extra
    - add-on
    - extra-google-m2repository
    - extra-android-m2repository

    # Google Play Services
    - extra-google-google_play_services
    # Support library
    - extra-android-support

    - addon-google_apis-google-$ANDROID_API_LEVEL
    - addon-google_apis-google-$EMULATOR_API_LEVEL

    - sys-img-armeabi-v7a-google_apis-$ANDROID_API_LEVEL
    - sys-img-armeabi-v7a-google_apis-$EMULATOR_API_LEVEL

  licenses:
    - 'android-sdk-preview-license-.+'
    - 'android-sdk-license-.+'
    - 'intel-android-extra-license.+'

before_script:
    - echo no | android create avd --force -n test -t "android-23" --abi $ANDROID_ABI --tag $ANDROID_TAG
    - emulator -avd test -no-window &
    - android-wait-for-emulator
    - adb shell input keyevent 82 &

如果有人需要更详细的项目信息,请查看。

好的,多喝点咖啡,让我的谷歌搜索更有效,解决了这个问题。详细描述了该问题。我不得不在我的代码中添加以下行(仍然不明白我需要这个25做什么,但至少它可以工作):


谢谢同样的逻辑也适用于针对Android SDK 26和使用构建工具26.0.1。我尝试了很多方法来接受丢失的许可证,我不知道为什么,但添加这些组件解决了不被接受的许可证问题。
- build-tools-25.0.1
- android-25