Трэвис CI: сбой сборки по таймауту.Лицензия не принята? - PullRequest
0 голосов
/ 03 мая 2019

Моя сборка не удалась в Travis CI. Не принимает Android SDK Лицензия:

 $ sdkmanager "system-images;android-28;google_apis;x86"
 Warning: File /home/travis/.android/repositories.cfg could not be loaded.   
 License android-sdk-license:
 ---------------------------------------
 Terms and Conditions
    .
    .
    . //bunch of terms here
    .
    .
  Accept? (y/N): 

Файл My Travis yml:

sudo: required
language: android
jdk: oraclejdk8
android:
  components:
    - tools
    - tools
    - platform-tools
    - build-tools-28.0.3
    - android-28
    - add-on
    - extra
before_install:
    - echo yes | sdkmanager "build-tools;28.0.3"
    - echo yes | sdkmanager "platforms;android-28"
    - mkdir "$ANDROID_HOME/licenses" || true
    - echo -e "\n8933bad161af4178b1185d1a37fbf41ea5269c55" > "$ANDROID_HOME/licenses/android-sdk-license"
    - echo -e "\n84831b9409646a918e30573bab4c9c91346d8abd" > "$ANDROID_HOME/licenses/android-sdk-preview-license"
    - sdkmanager "system-images;android-28;google_apis;x86"
    - echo no | avdmanager create avd --force -n emulatorApi28 -k "system-images;android-28;google_apis;x86"
    - emulator -avd test -no-audio -no-window &
    - ./gradlew dependencies || true
before_script:
    - android-wait-for-emulator
    - adb shell input keyevent 82 &
script:
    - ./gradlew build connectedCheck
    - "./gradlew clean build connectedCheck -PdisablePreDex --stacktrace"
before_cache:
    - $HOME/.gradle/caches/
    - $HOME/.gradle/wrapper/
    - $HOME/.android/build-cache
cache:
    directories:
        -$HOME/.gradle/caches/
        -$HOME/.gradle/wrapper/s
licenses:
    - 'android-sdk-preview-license-.+'
    - 'android-sdk-license-.+'
    - 'google-gdk-license-.+'

Есть предложения?

РЕДАКТИРОВАТЬ :

sudo: required
language: android
jdk: oraclejdk8
android:
    licenses:
    - 'android-sdk-preview-license-.+'
    - 'android-sdk-license-.+'
    - 'google-gdk-license-.+' 
  components:
    - tools
    - tools
    - platform-tools
    - build-tools-28.0.3
    - android-28
    - add-on
    - extra
before_install:
    - echo y | sdkmanager "build-tools;28.0.3"
    - echo y | sdkmanager "platforms;android-28"
    - mkdir "$ANDROID_HOME/licenses" || true
    - echo -e "\n8933bad161af4178b1185d1a37fbf41ea5269c55" > "$ANDROID_HOME/licenses/android-sdk-license"
    - echo -e "\    " > "$ANDROID_HOME/licenses/android-sdk-preview-license"
    - sdkmanager "system-images;android-28;google_apis;x86"
    - echo no | avdmanager create avd --force -n emulatorApi28 -k "system-images;android-28;google_apis;x86"
    - emulator -avd test -no-audio -no-window &
    - ./gradlew dependencies || true
before_script:
    - android-wait-for-emulator
    - adb shell input keyevent 82 &
script:
    - ./gradlew build connectedCheck
    - "./gradlew clean build connectedCheck -PdisablePreDex --stacktrace"
before_cache:
    - $HOME/.gradle/caches/
    - $HOME/.gradle/wrapper/
    - $HOME/.android/build-cache
cache:
    directories:
        -$HOME/.gradle/caches/
        -$HOME/.gradle/wrapper/sis?

1 Ответ

1 голос
/ 03 мая 2019

Посмотрите на документацию , часть licenses должна находиться под частью android. Так и должно быть:

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