Contact: emailremoved@

Bintray is a download center with REST automation & support for RPM & Debian packages. It is often used to distribute Android libraries via Maven or/and jCenter repositories.

Here are the detailed steps to distribute your Android library via Maven or/and jCenter:

  1. Create and setup your Bintray account

    • Log into your corporate Bintray account
    • Click on "Add a new repository" button to create your repo

      • Private access could be used while you are preparing the final release in order to hide it from non-authorized users. But to download and use the package, your username and private API key should be included inside '' file linked to your sample app's 'build.gradle.'
        When you are ready to open your package to the World, change an access to Public.

      • Name (aka <repo_name>) is an important part, since it can't be changed in future. And it will be the first part of your repository's public url.

      • For Type just select "Maven"

      • Check the option: “GPG sign uploaded files using Bintray's public/private key pair”.

    • Then you can click on "Add new package" button in order to fill up all the package details via web interface.
      Or you can just specify them inside your 'build.gradle' file during Step 2.

  2. Prepare your Android project

    • Add necessary dependencies:

      // build.gradle
      dependencies {
        // You probably already have this:
        classpath ''
        // So just add bintray and maven plugins:
        classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.6'
        classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1'
    • Apply corresponding plugins:

      // build.gradle
      apply plugin: ''
      apply plugin: 'com.jfrog.bintray'
    • Include "install" and "bintray" targets

      • Here is the detailed guide with examples from Bintray:
      • Here is the complete 'build.gradle' from them:
      • My minimal set of changes (I didn't use a github repository for this project):

        // build.gradle:
        Properties properties = new Properties()
        bintray {
           user = properties.getProperty("bintray.user")
           key = properties.getProperty("bintray.apikey")
           configurations = ['archives']
           pkg {
               repo = '<repo_name>'
               name = '<package_name>'
               userOrg = 'google'
               desc = '<description_of_your_library>'
               publicDownloadNumbers = false
        install {
            repositories.mavenInstaller {
                pom.project {
                    name '<your_library_name>'
                    description '<description_of_your_library>'
                    packaging 'aar'
                    developers {
                        developer {
                            name 'google'
                            id properties.getProperty('')
                            email properties.getProperty('')


      • Add javadoc and source tasks if you wish your library's users are able to access them.

        // build.gradle
        task sourcesJar(type: Jar) {
            classifier = 'sources'
        task javadoc(type: Javadoc) {
            source =
            ext.androidJar = "${android.sdkDirectory}/platforms/${android.compileSdkVersion}/android.jar"
            classpath += (project.files(android.getBootClasspath().join(File.pathSeparator))
            + files(ext.androidJar))
            failOnError false
        afterEvaluate {
            javadoc.classpath += files(android.libraryVariants.collect
            { variant ->
        task javadocJar(type: Jar, dependsOn: javadoc) {
            classifier = 'javadoc'
            from javadoc.destinationDir
        artifacts {
            archives javadocJar
            archives sourcesJar
  3. Install and upload your library into Bintray

    • Just open the ‘Terminal’ tab inside Android Studio or anywhere else and type:

      ./gradlew build install bintrayUpload --info
    • Check that your library and files are now inside your Bintray’s repo via web interface

      • Navigate to :<repo_name>/<your_package>
      • Open tab 'Files' and check if there are *.jar, *.ask and *.pom files
  4. Test that everything works from your sample app

    • In order to include your library into an Android sample app, just update 'build.gradle' of it with the following lines:

      • For Public repos:

        // build.gradle
        repositories {
            maven {
                url "http://linkremoved/>"
        } dependencies {
            compile '<your_package>:<library_name>:<version>'
      • For Private ones:

        // build.gradle
        repositories {
            maven {
                url "http://linkremoved/>"
            credentials {
                username 'USERNAME@google'
                password '<your_API_key>'
        } dependencies {
            compile '<your_package>:<library_name>:<version>'
    • Then just try to use some classes and methods from your library:

      • Verify that sample app compiles without errors
      • Check that Android Studio correctly shows the javadoc.
  5. Add your library to jCenter (optional)

    • If you wish to distribute your library via jCenter as well as via Maven, then you need to:

      • Check if there is a button "Add to JCenter" in the lower right corner of your package’s Bintray page:<repo_name>/<your_package>

        • Click it if you see the button
      • Otherwise, write an email to emailremoved@ about your project and ask him to enable jCenter distribution for your package

Useful resources from 3rd party developers: