How to make an aar in Android Studio and upload it to a repository

Posted on 2014-12-26
Medium Priority
Last Modified: 2015-01-23
I have the following build.gradle file :

apply plugin: 'android-library'
apply plugin: 'maven'

android {
    compileSdkVersion 19
    buildToolsVersion '19.1'
    sourceSets {
        main {
            manifest.srcFile 'AndroidManifest.xml'
            java.srcDirs = ['src']
    defaultConfig {
        minSdkVersion 15
        targetSdkVersion 19
        versionCode 1
        versionName "1.0"

   lintOptions {
        abortOnError false

dependencies {
    compile project(':olympus-commons')
    compile project(':stream-client')
    compile project(':door-proxy')

    compile 'com.google.guava:guava:17.0'

    compile 'to.talk.aragorn:logging:0.1-SNAPSHOT@aar'
    compile 'to.talk.aragorn:event-utils:0.1-SNAPSHOT@aar'
    compile 'to.talk.aragorn:commons:0.30-SNAPSHOT@aar'


def coreAarFile = file('build/conman-client.aar')
artifacts {
    archives coreAarFile

uploadArchives {
    repositories {
        mavenDeployer {
            repository(url: "http://ci.aws.talk.to:8081/nexus/content/repositories/snapshots",
                    authentication: [
                            userName: 'deployer',
                            password: 'qwedsa'
            pom.groupId = 'to.talk.legolas'
            pom.artifactId = 'conman-client'
            pom.version = '1.01-SNAPSHOT'

Open in new window

When i build my module it builds sucessfully and there is a build folder output but i dont see the conman-client.aar file there.

How to use gradle to upload a file to repository
Question by:Rohit Bajaj
1 Comment
LVL 21

Accepted Solution

Amitkumar P earned 2000 total points
ID: 40529066
Is there any directory called  build/outputs/aar/ genereated ? If so, please check at that location.

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

In real business world data are crucial and sometimes data are shared among different information systems. Hence, an agreeable file transfer protocol need to be established.
A discussion about automated testing of Web Applications utilizing Selenium, along with illustrated configuration steps for the Jenkins open source tool.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Suggested Courses

600 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question