Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create a release android library package (aar) in Android Studio (not debug)

I have built my android library package (aar) and the result of build is created in "..\app\build\outputs\aar" folder. The file within this folder is called "app-debug.aar" so I guess it has been built in debug mode so I would like to know how to genereate the release built, that is, "app-release.aar". How can I do this? Also, is it possible to genereate the build with another custom name, for example, "myCustomAppName-release.aar" instead of "app-release.aar".

like image 764
Ralph Avatar asked Dec 25 '14 10:12

Ralph


People also ask

Where do I put AAR file in android project?

Add your AAR or JAR as a dependency Navigate to File > Project Structure > Dependencies.

How do I create a library for android?

Creating The Android Library Open Android Studio and create a new Project. Name your application as ToasterExample and your project name as Toaster. The ToasterExample will be our sample application to show an example use of our application. Click on Finish and your project will be ready.

What is the difference between AAR and jar?

The difference between JAR and AAR JAR is just a Java library containing java class files and nothing more. AAR is a format for android libraries which contains a JAR file, android resource file (like layout XML, attribute XML, etc..) and an android manifest file.


2 Answers

In Android Studio 1.2+, there is a complete gradle menu that lists all of the available gradle tasks.

I found this menu on the right side of the IDE with default options enabled.

The gradle menu is on the right side of the IDE by default...

Right click the task you want and click "Run".

Right click the task you want a click "RUN"

like image 160
jiminikiz Avatar answered Sep 23 '22 18:09

jiminikiz


With Android Studio 3.0 is easier to generate aar file. From the Gradle option, chek for the option as shown in the picture enter image description here

like image 30
leeCoder Avatar answered Sep 22 '22 18:09

leeCoder