'Android Studio release build does not output aar

I have create a very simple 'Android Library' module with only one class which builds fine in debug releasing build/output/library-debug.aar

But, when I switch to release, even though it says build successful, the aar is not there.

The Android Studio project only has this library module.

Thanks for advance.



Solution 1:[1]

To get the aar, you can do the following

1) “View/Tool Windows/Gradle”, to open the gradle window

2) From gradle window, run assembly Gradle task by double-click on My_Plugin_Android/:My_Plugin/Tasks/build/assemble

Then the release and debug aars are outputed.

Solution 2:[2]

Here are the steps:

Step1: In Android studio open 'gradle' window.
Step2: Select your library from the gradles projects
Step3: Click on Tasks => build => assemble

The aar file will be generated in 'build/outputs' folder in finder window.

Solution 3:[3]

Ensure that the following line is there in your build.gradle file

apply plugin: 'com.android.library'
  • Open gradle window in android studio (Look at right top corner)
  • Double click on Library => Tasks => build => assemble

Solution 4:[4]

From Gradle > select your project > Tasks > Build > build dependents

As shown in below image :

enter image description here

Solution 5:[5]

Set up your project as an Android library.
In build.gradle file: plugin: 'com.android.library'
You can see the output in: build/outputs/aar/[your module].

Read this article about your problem.

Solution 6:[6]

In build.gradle:MyModule

plugins {
    id 'com.android.library'
}

Remove android -> defaultConfig -> applicationId if it was attached.

Sync and build from Gradle task menu

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Abdalla
Solution 2 GvSharma
Solution 3 Codemaker
Solution 4 parul
Solution 5 Carlos Vázquez Losada
Solution 6 freezing_