Can';t使用Travis CI和Android构建项目
在过去的两天里,我一直在尝试用travis和android构建CI 问题是,无论我如何解决一个问题,都会出现另一个问题 我在堆栈中搜索anwser,但没有人解决我的问题 您尚未接受以下SDK组件的许可协议: [com.android.support.constraint:constraint-layout:1.0.0-alpha4,com.android.support.constraint:constraint-layout-solver:1.0.0-alpha4] My root build.gradle:Can';t使用Travis CI和Android构建项目,android,github,continuous-integration,travis-ci,Android,Github,Continuous Integration,Travis Ci,在过去的两天里,我一直在尝试用travis和android构建CI 问题是,无论我如何解决一个问题,都会出现另一个问题 我在堆栈中搜索anwser,但没有人解决我的问题 您尚未接受以下SDK组件的许可协议: [com.android.support.constraint:constraint-layout:1.0.0-alpha4,com.android.support.constraint:constraint-layout-solver:1.0.0-alpha4] My root build
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.0-beta1'
//Dagger 2 dependency
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
//Realm Dependecies
classpath "io.realm:realm-gradle-plugin:1.1.1"
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
应用程序build.gradle
apply plugin: 'com.android.application'
apply plugin: 'com.neenbedankt.android-apt'
//Realm Dependecies
apply plugin: 'realm-android'
android {
signingConfigs {
}
compileSdkVersion 24
buildToolsVersion "24.0.1"
dataBinding {
enabled = true
}
defaultConfig {
applicationId "rhcloud.com.financialcontrol"
minSdkVersion 15
targetSdkVersion 24
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
androidTestCompile('com.android.support.test:runner:0.5', {
exclude group: 'com.android.support', module: 'support-annotations'
})
androidTestCompile('com.android.support.test:rules:0.5', {
exclude group: 'com.android.support', module: 'support-annotations'
})
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
testCompile 'junit:junit:4.12'
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:24.1.1'
compile 'com.android.support:design:24.1.1'
//Dagger 2 dependencies
apt 'com.google.dagger:dagger-compiler:2.0'
compile 'com.google.dagger:dagger:2.0'
provided 'javax.annotation:jsr250-api:1.0'
compile 'klauswk:DroidUtils:0.1-ALPHA'
}
特拉维斯·伊梅尔先生
android:
components:
- tools
- platform-tools
- build-tools-24.0.1
- android-24
- extra-android-m2repository
- extra-android-support
- sys-img-armeabi-v7a-android-22
- extra-google-google_play_services
licenses:
- android-sdk-preview-license-52d11cd2
- android-sdk-license-.+
- google-gdk-license-.+
before-script:
- "android update sdk --no-ui --filter build-tools-24.0.1,android-24,extra-android-m2repository"
- "echo no | android create avd --force -n test -t android-22 --abi armeabi-v7a"
- "emulator -avd test -no-skin -no-audio -no-window &"
- android-wait-for-emulator
- "adb shell input keyevent 82 &"
before_cache:
- "rm -f $HOME/.gradle/caches/modules-2/modules-2.lock"
before_install:
- "chmod +x gradlew"
cache:
directories:
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/
env:
matrix:
- "ANDROID_TARGET=android-22 ANDROID_ABI=armeabi-v7a"
jdk: oraclejdk8
language: android
script:
- "./gradlew build connectedCheck --stacktrace"
任何帮助将不胜感激,源代码可以找到
编辑
我终于成功了
首先,为了解决许可证问题,我将buildtools降级并编译到23,并添加了'com.android.support.constraint:constraint layout:1.0.0-alpha1'
作为依赖项
另外,通过Ardock的anwser,我在travis.yml中找到了一个错误
最后,我添加了android-sdk-license-c81a61d9
以自动接受许可证
工作提交可以找到编辑: 将脚本之前的
替换为脚本之前的
否则不会执行此块
先前的响应:
看
跳过“ARM EABI v7a系统映像,Android API 22,修订版1”;信息技术
取决于“SDK平台Android 5.1.1,API 22,修订版2”,该版本
未安装
看起来您已经解决了许可证问题,但您需要安装android-22平台
android:
components:
- tools
- ...
- android-22
- sys-img-armeabi-v7a-android-22
- ...
或android-23要解决的图像:
com.android.builder.testing.api.DeviceException:没有连接的设备
在更新android时,您需要接受许可协议(即在您的Prefore脚本块中的android update命令)