我想让Travis构建我的Android项目.它尝试下载库时失败ConstraintLayout.你知道我要做些什么才能让它发挥作用吗?
我的.travis.yml是这样的:
language: android
jdk:
- oraclejdk8
android:
components:
- platform-tools
- tools
- build-tools-23.0.2
- android-23
- extra-android-support
- extra-android-m2repository
- extra-google-m2repository
Run Code Online (Sandbox Code Playgroud)
我build.gradle是:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "my.example.bdd"
minSdkVersion 9
targetSdkVersion 23
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha2'
testCompile 'junit:junit:4.12'
androidTestCompile …Run Code Online (Sandbox Code Playgroud) 在我写这个问题之前,我已经搜索了相同的问题,他们确实导出了许可证,因为仍然使用alpha版本的约束布局.但是现在android已经发布了稳定版的约束布局.我尝试了很多设置,但仍然失败了..
我的最新消息 .travis.yml
language: android
jdk: oraclejdk8
android:
components:
- platform-tools
- tools # to get the new `repository-11.xml`
- tools # see https://github.com/travis-ci/travis-ci/issues/6040#issuecomment-219367943)
- build-tools-25.0.0
- android-25
# Additional components
- extra-google-google_play_services
- extra-google-m2repository
- extra-android-m2repository
licenses:
- 'android-sdk-preview-license-52d11cd2'
- 'android-sdk-license-.+'
- 'google-gdk-license-.+'
script:
- ./gradlew clean build
Run Code Online (Sandbox Code Playgroud)
这是我的 build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion '25.0.0'
defaultConfig {
applicationId "com.package.my"
minSdkVersion 16
targetSdkVersion 25
versionCode 6
versionName "1.3.1"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled …Run Code Online (Sandbox Code Playgroud) android gradle android-sdk-tools travis-ci android-constraintlayout
我正在尝试用Travis构建我的Android项目,目前我收到错误:
A problem occurred configuring project ':app'.
> You have not accepted the license agreements of the following SDK
components:
[Android SDK Build-Tools 27.0.1].
Run Code Online (Sandbox Code Playgroud)
我不知道怎么样,但昨天我可以解决问题:
before_install:
- yes | sdkmanager "platforms;android-27"
Run Code Online (Sandbox Code Playgroud)
但现在它对我没有帮助.我会很感激任何建议.
这是构建URL https://travis-ci.org/madsunrise/luna-mobile/jobs/325034903,我也把travis.yml放在下面
sudo: required
language: android
jdk: oraclejdk8
notifications:
email:
recipients:
- rudnev.vanya@gmail.com
on_success: change
on_failure: always
before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -rf $HOME/.gradle/caches/*/plugin-resolution/
before_install:
- yes | sdkmanager "platforms;android-27"
cache:
directories:
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/
- $HOME/.android/build-cache
env:
global:
- ANDROID_API=27
- ANDROID_BUILD_TOOLS=27.0.2
android: …Run Code Online (Sandbox Code Playgroud)