title: Travis Ci build error caused by Android SDK license agreements
body: <p>I have experience with <strong>CircleCi</strong>:</p>
  
  <blockquote>
    <p><a href="https://circleci.com/gh/mmirhoseini/fyber_mobile_offers/28" rel="noreferrer">https://circleci.com/gh/mmirhoseini/fyber_mobile_offers/28</a></p>
  </blockquote>
  
  <p>but I cannot solve this license issue with the same repository on <strong>TravisCi</strong>:</p>
  
  <blockquote>
    <p><a href="https://travis-ci.org/mmirhoseini/fyber_mobile_offers/builds/167852390" rel="noreferrer">https://travis-ci.org/mmirhoseini/fyber_mobile_offers/builds/167852390</a></p>
  </blockquote>
  
  <p>This is travis error log:</p>
  
  <blockquote>
    <p>FAILURE: Build failed with an exception.</p>
    
    <p>What went wrong: A problem occurred configuring project ':fyber-app'.</p>
    
    <p>You have not accepted the license agreements of the following SDK components:   [SDK Patch Applier v1, Google Repository].</p>
    
    <p>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 <a href="http://d.android.com/r/studio-ui/export-licenses.html" rel="noreferrer">http://d.android.com/r/studio-ui/export-licenses.html</a></p>
  </blockquote>
  
  <p><a href="https://i.stack.imgur.com/hwaVs.png" rel="noreferrer"><img src="https://i.stack.imgur.com/hwaVs.png" alt="Travis Ci Screenshot"></a></p>
  
  <p>I know that it is a license issue but don't know how to solve it. Here is my <strong>.travis.yml</strong> file:</p>
  
  <pre><code>language: android
  
  sudo: required
  
  android:
    components:
      - tools
      - platform-tools
      - build-tools-24.0.2
      - android-24
      - extra-android-m2repository
    licenses:
      - 'android-sdk-preview-license-.+'
      - 'android-sdk-license-.+'
      - 'intel-android-extra-license.+'
  
  jdk:
    - oraclejdk8
  
  before_install:
    - chmod +x gradlew
  
  script:
    - ./gradlew build
  </code></pre>