Android: Setup Travis-CI

Datetime:2016-08-23 02:29:16         Topic: Andrew Development          Share        Original >>
Here to See The Original Article!!!


Travis CI is a free continuous integration environment, i.e a container that download everything it needs to build your android project and then builds (and opitionally tests) it, for open source projects.

  1. Create a new Android project using a basic template in Android Studio. I’m using Android Studio 2.1.1.
  2. Create a new github project for that and upload your project there, including the gradle wrapper.
  3. Now goto and login by pressing the login with your github account button.
  4. Click add new repository on travis-ci. Press the sync account button at the top. Now you should be able to enable travis-ci for your new repo by pressing the toggle swich.
  5. In your app/build.gradle file note the BuildToolsVersion you’re using and the targetSdkVersion
  6. Create a file called .travis.yml in your repo and upload it to github

    language: android
     java: oraclejdk8 # We need this if your sdk version is 24
         # Uncomment the lines below if you want to
         # use the latest revision of Android SDK Tools
         - platform-tools
         - tools
         # The BuildTools version used by your project
         - build-tools-YOUR_NOTED_BUILD_TOOLS_VERSION
         # The SDK version used to compile your project
         # Additional components
         #- extra-google-google_play_services
         - extra-google-m2repository
         - extra-android-m2repository
         - addon-google_apis-google-19
       - ./gradlew build

Now refresh and you should see your project building eventually.

You can now add a fun button to your showing your project has built via:

[![Build Status](](


Put your ads here, just $200 per month.