Simcha
Simcha

Reputation: 3400

Creating *.aar library

Hi I'm a new in Android development and using Android studio. I need to create *.aar lib. I created New Android library project (empty for now). How to generate *.aar file from it? Can you explain by steps? Has read a lot of topics but still unsuccessful. Thanks.

enter image description here

Upvotes: 2

Views: 5812

Answers (2)

Noah Ternullo
Noah Ternullo

Reputation: 677

Here's what has worked for me.

  1. on the command line go to the root directory of the project

  2. ensure that your JAVA_HOME environment variable points to the version of the java sdk you are going to use. On a Mac via the bash shell that would look something like this:

    export JAVA_HOME='/Library/Java/JavaVirtualMachines/jdk1.8.0_11.jdk/Contents/Home'

(click here to find out how to find your Java Home)

  1. To clean type ./gradlew clean
  2. To build the library type ./gradlew aR (This may take a while)

You should now find the .aar file in mymodulename/build/outputs/aar

Thanks to geekgarage for clarification.

Upvotes: 4

Simcha
Simcha

Reputation: 3400

Thanks for @pskink, found out, need to build it like: "gradlew assemble" from the root of project.

Upvotes: 1

Related Questions