How to create a release android library package (aar) in Android Studio (not debug)
Solution 1:
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.
Right click the task you want and click "Run".
Solution 2:
With Android Studio 3.0 is easier to generate aar file. From the Gradle option, chek for the option as shown in the picture
Solution 3:
This issue of can already be handled with the answers like execute
./gradlew assembleRelease
or choose assembleRelease from Android Studio's Gradle menu. However, for completeness, with Android Studio 1.5.1 (and probably also older versions) building release version of a .aar can be accomplished by selecting Build->Build APK in Android Studio. It seems to execute assembleRelease. If your project only contains the library project, it does not ask for any signing information.