Android dancing logo

Announcing Android AAR Support

TL;DR

You can now upload your Android projects (AAR files) to packagecloud.io! Easily share them publicly or privately. Read on to find out the different ways to upload, download, and depend on AAR files.

 

How to upload AAR files

There are various ways to upload your Android project files to packagecloud.io. You can use Gradle/Maven (recommended), our CLI tool, or our API.

 

You can configure Gradle to upload Android AAR files by following the steps in our documentation for Gradle deploy.

Once configured, you can run uploadArchives in your Gradle project to upload your Android AAR files to packagecloud.io.

$ gradle uploadArchives

 

You can configure Maven to upload Android AAR files by following the steps in our documentation for Maven deploy.

Once configured, you can run deploy in your Maven project to upload your Android AAR files to packagecloud.io.

$ mvn deploy

CLI

You can also push your Android AAR file using our CLI. Make sure you are running version 0.2.41 or above.

$ package_cloud push capotej/my_repo/java my_android_project.aar

In the case that we cannot detect the groupId, version, or artifactId (the maven coordinates, or you wish to override the detected values, you’ll need to pass them in using the --coordinates= option, like so:

$ package_cloud push capotej/my_repo/java my_android_project.aar --coordinates="com.capotej:myproject:2.0"

 

API

You can also use the packages create API to upload AAR files. Similarly to the CLI, you might need to pass a package[coordinates] parameter if we cannot detect it from the package itself.

 

How to depend on AAR files

Once your Android AAR file is uploaded, you can visit it’s package page on packagecloud.io to view the install instructions for Maven or Gradle. Depending on Android AAR files is similar to other dependencies, except they use a packaging of aar.

aar install instructions

Gradle

In Gradle, this is denoted using an trailing @ sign on your dependency. For example:

 

Example dependency definition in build.gradle

compile 'io.packagecloud.android:my-library:1.0@aar'

 

Maven

In Maven, this is denoted using <packaging>aar</packaging> in your dependency. For example:

 

Example dependency definition in pom.xml

<dependency>
  <groupId>io.packagecloud.android</groupId>
  <artifactId>my-library</artifactId>
  <version>1.0</version>
  <packaging>aar</packaging>
</dependency>

 

How to download Android AAR files

You can download the Android AAR files by visiting it’s package page and clicking the download button next to the artifact and checksum listing, as shown below.

 

Downloading Android AAR files

aar download button

 

Conclusion

That’s it! Please report any bugs you find by emailing packagecloud support at support@packagecloud.io. Thanks!

You might also like other posts...