我的Travis配置(据我所知)只使用API 27和构建工具版本27.0.3。但由于某些原因,Travis构建失败了,称Android 28和build tools 28.0.3许可证不被接受。我从未在我的.travis.yml文件中指定过这些版本。
language: android
sudo: required
jdk: oraclejdk8
env:
global:
- ANDROID_API_LEVEL=27
- ANDROID_BUILD_TOOLS_VERSION=27.0.3
- ANDROID_ABI=armeabi-v7a
android:
components:
- tools
- platform-tools
- tools # appears twice as per Travis docs
- build-tools-$ANDROID_BUILD_TOOLS_VERSION
- android-$ANDROID_API_LEVEL
- extra-android-m2repository
licenses:
- 'android-sdk-preview-license-52d11cd2'
- 'android-sdk-license-.+'
- 'google-gdk-license-.+'
before_install:
- touch $HOME/.android/repositories.cfg
before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
cache:
directories:
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/
- $HOME/.android/build-cache
before_script:
- chmod +x gradlew
script:
- ./gradlew clean build
- ./gradlew test特拉维斯的错误是:
> Failed to install the following Android SDK packages as some licences have not been accepted.
build-tools;28.0.3 Android SDK Build-Tools 28.0.3
platforms;android-28 Android SDK Platform 28
To build this project, accept the SDK license agreements and install the missing components using the Android Studio SDK Manager.
Alternatively, to transfer the license agreements from one workstation to another, see http://d.android.com/r/studio-ui/export-licenses.html有什么特别的地方我应该删除吗?
发布于 2019-02-23 10:02:02
我通过使用SDK的sdk-manager来安装平台和构建工具来解决这个问题,而不是特拉维斯的Android组件。有关完整的教程,请参阅https://medium.com/@fawwazyusran/how-to-travis-ci-working-for-android-api-level-28-2fde7292813c上的文章。
https://stackoverflow.com/questions/54436695
复制相似问题