Tôi hiện đang sử dụng CircleCI cho dự án của mình. Ngoài ra, tôi đang triển khai constraintLayout mới trong dự án của mình. Bây giờ tôi đang mắc kẹt với tòa nhà CircleCI. Nó chỉ cho tôi điều này khi gradle -dependencies chạy:CircleCI Android constraintLayout không hoạt động
File /home/ubuntu/.android/repositories.cfg could not be loaded.
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:
[com.android.support.constraint:constraint-layout:1.0.0-alpha3, com.android.support.constraint:constraint-layout-solver:1.0.0-alpha3].
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
Dưới đây là cấu hình của tôi trong tập tin .yml:
#Install android build tools, platforms
#Supported versions here https://circleci.com/docs/android
machine:
java:
version: openjdk8
environment:
ANDROID_HOME: /usr/local/android-sdk-linux
dependencies:
pre:
- echo y | android list sdk
- echo y | android update sdk --no-ui --all --filter "tools"
- echo y | android update sdk --no-ui --all --filter "platform-tools"
- echo y | android update sdk --no-ui --all --filter "build-tools-24.0.0"
- echo y | android update sdk --no-ui --all --filter "android-24"
- echo y | android update sdk --no-ui --all --filter "extra-google-m2repository"
- echo y | android update sdk --no-ui --all --filter "extra-google-google_play_services"
- echo y | android update sdk --no-ui --all --filter "extra-android-support"
- echo y | android update sdk --no-ui --all --filter "extra-android-m2repository"
- (./gradlew -version):
timeout: 360
override:
#- ANDROID_HOME=/usr/local/android-sdk-linux ./gradlew dependencies
- export TERM="dumb"; if [ -e ./gradlew ]; then ./gradlew clean dependencies -stacktrace;else gradle clean dependencies -stacktrace;fi
#Pull any submodules
checkout:
post:
- git submodule init
- git submodule update
#-PdisablePreDex is a must else gradle just dies due to memory limit
#Replace
test:
override:
- (./gradlew assemble -PdisablePreDex):
timeout: 360
- cp -r ${HOME}/${CIRCLE_PROJECT_REPONAME}/app/build/outputs/apk/ $CIRCLE_ARTIFACTS
- emulator -avd circleci-android22 -no-audio -no-window:
background: true
parallel: true
# wait for it to have booted
- circle-android wait-for-boot
# run tests against the emulator.
- ./gradlew connectedAndroidTest
#Deploy when tests pass
deployment:
#production:
# branch: master
# commands:
# - (./gradlew clean assembleRelease crashlyticsUploadDistributionRelease -PdisablePreFex):
# timeout: 720
staging:
branch: staging
commands:
- (./gradlew clean assembleStaging crashlyticsUploadDistributionStaging -PdisablePreFex):
timeout: 720
Tôi đã kiểm tra trong việc xây dựng log khi
echo y | android update sdk --no-ui --all --filter "extra-android-m2repository"
lệnh chạy và đây là kết quả:
November 20, 2015
Do you accept the license 'android-sdk-license-c81a61d9' [y/n]:
Installing Archives:
Preparing to install archives
Downloading Android Support Repository, revision 33
Installing Android Support Repository, revision 33
Installed Android Support Repository, revision 33
Done. 1 package installed.
Và classpath của tôi là:
classpath 'com.android.tools.build:gradle:2.2.0-alpha4'
Tôi không chắc chắn những gì tôi đã thực hiện không đúng cách hoặc là có bất cứ điều gì tôi cần phải bổ sung thêm. Xin đề nghị. Cảm ơn.
Cảm ơn, cuối cùng tôi đã tìm thấy con đường để xuất khẩu License để CI bằng cách thêm các phụ thuộc đến trước: - cp -r $ {HOME}/$ {CIRCLE_PROJECT_REPONAME}/android-sdk-license $ ANDROID_HOME - cp -r $ {HOME}/$ {CIRCLE_PROJECT_REPONAME}/android-sdk-preview-license $ ANDROID_HOME Ngoài ra tôi đặt giấy phép android-sdk và android-sdk- giấy phép xem trước trong repo của tôi – Jutikorn
Đây là một mẹo tuyệt vời! Nhưng tôi khuyên bạn nên đặt nội dung của 'android-sdk-license' và' android-sdk-preview-license' làm hai biến môi trường Circle CI riêng biệt, vì các env vars được bảo vệ, điều này không nhất thiết phải đúng với VCS repo. – dbm
@Jutikorn tôi có thể tải xuống ở đâu? Tôi chỉ tìm thấy 'android-sdk-license' – Spurdow