Can't build project with Travis-CI and Android
<p>I've been trying for the past 2 days build a CI with travis and android.</p>

<p>The problem is, whatever i fix a problem, another comes up</p>

<p>I search in stack for the anwser, but none fix my problem</p>

<blockquote>
  <p>You have not accepted the license agreements of the following SDK components:
    [com.android.support.constraint:constraint-layout:1.0.0-alpha4, com.android.support.constraint:constraint-layout-solver:1.0.0-alpha4].</p>
</blockquote>

<p>My root build.gradle:</p>

<pre><code>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
}
</code></pre>

<p>app build.gradle</p>

<pre><code>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'

}
</code></pre>

<p>.travis.yml</p>

<pre><code>    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 &amp;"
  - android-wait-for-emulator
  - "adb shell input keyevent 82 &amp;"
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"
</code></pre>

<p>Any help would be appreciate, the source code can be find <a href="https://github.com/Klauswk/FinancialControl" rel="nofollow">here</a></p>

<h1> EDITED </h1>

<p>I finally manage to make it work.</p>

<p>First, to fix the license problem, i downgrade the buildtools and compile down to 23, and added <code>'com.android.support.constraint:constraint-layout:1.0.0-alpha1'</code> as dependency.</p>

<p>Also, by the anwser of Ardock, i manage to find a error in my travis.yml.</p>

<p>Finally, i added the <code>android-sdk-license-c81a61d9</code> to automatic accept the license.</p>

<p>The working commit can be find <a href="https://github.com/Klauswk/FinancialControl/commit/0f588d072863ee8046d27c090c9ed03b69fe5fdc" rel="nofollow">here</a></p>