2016-12-12 1 views
3

"당신은 라이센스 계약을 승인하지 않은"실패, 나는 다음과 같은 트래비스-CI 구성이 :트래비스-CI 빌드

language: android 
jdk: oraclejdk8 
android: 
    components: 
    - build-tools-22.0.1 
    - android-22 
    - extra-google-m2repository 
before_install: 
- openssl aes-256-cbc -K $encrypted_8bf9e2e639dc_key -iv $encrypted_8bf9e2e639dc_iv 
    -in secrets.tar.enc -out secrets.tar -d 
- tar xvf secrets.tar 
- chmod +x gradlew 

가 나는 다음과 같은 오류 얻을 구축하려고 :

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: 
    [ConstraintLayout for Android 1.0.0-alpha7, Solver for ConstraintLayout 1.0.0-alpha7]. 
    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 
Total time: 1 mins 17.927 secs 
The command "./gradlew build connectedCheck" exited with 1. 
Done. Your build exited with 1. 

이제 travis 설명서에서 밝히고있는 것처럼 travis는 기본적으로 모든 라이센스를 허용하므로이 문제가 발생하지 않아야합니다.

해결 방법이 있습니까?

+0

동일하지 않은 경우 여기, 일부 답변이 https://stackoverflow.com/questions/42731625/travis-ci-failed-because-cannot-accept-license-constrain-layout/45622155 매우 유사합니다. # 45622155 –

답변

2

또 다른 O 다음 단계에

before_install: 
    - mkdir "$ANDROID_HOME/licenses" || true 
    - echo -e "\n8933bad161af4178b1185d1a37fbf41ea5269c55" > "$ANDROID_HOME/licenses/android-sdk-license" 
    - echo -e "\n84831b9409646a918e30573bab4c9c91346d8abd" > "$ANDROID_HOME/licenses/android-sdk-preview-license" 

당신이 여기에서 자세한 내용을 찾을 수 있습니다 : schnatterer의 대답은 아주 가까이

+0

더 많은 최신 버전의 Android SDK에서 sdkmanager로이 작업을 수행 할 수 있습니다. https://stackoverflow.com/a/48125084/274350을 참조하십시오. –

0

어쨌든 ConstraintLayout을 사용하지 않았으므로 gradle에서 ConstraintLayout 종속성을 제거하여이 문제를 해결했습니다. Travis는 ConstraintLayout에 대한 라이센스를 감지/승인하지 않는 것으로 보입니다.

0

당신은 아직도 당신의 repo에 라이센스 파일을 안드로이드 SDK의 디렉토리에서

  1. 복사 licenses 폴더를 내보내 로컬 컴퓨터에 수락 한 모든 라이센스를 받아 들일 수
  2. 추가 (의 예를 들어 android-licenses 그것을 이름을 보자) 당신의 .travis.yml 파일 before_script: 구역에
 
    - mkdir -p "$ANDROID_HOME/licenses" 
    - cp ./android-licenses/ "$ANDROID_HOME/licenses/" 
0

@ 모든 라이센스를 수용하기위한 ption는 다음과 같습니다. 난 그냥이 라이센스를 accepteting없이 작동하는 SDK (27)를 가져올 수 없습니다 :

before_install: 
    - mkdir "$ANDROID_HOME/licenses" || true 
    - echo -e "\n8933bad161af4178b1185d1a37fbf41ea5269c55\nd56f5187479451eabf01fb78af6dfcb131a6481e" > "$ANDROID_HOME/licenses/android-sdk-license" 
    - echo -e "\n504667f4c0de7af1a06de9f4b1727b84351f2910" > "$ANDROID_HOME/licenses/android-sdk-preview-license" 

이 신구 (26.0.2+) SDK 라이센스 SHA1을 추가

설명 :

Android SDK를 사용하려면 사용권 계약에 동의해야합니다. 따라서 라이센스 이름이 $ANDROID_HOME/licenses 인 파일이 필요합니다. 파일의 내용은 허용 된 계약 버전 (각 행의 해시)의 sha1 해시입니다 (추측). 본인은 라이센스 계약의이 특정 버전을 이해하고 이에 동의한다는 기술적 인 방법입니다. 때때로 계약이 변경되므로 SDK 업데이트에서 새 해시를 추가/교체해야 할 수 있습니다.