Using Android Studio, I have an Android library project which produces 'library/build/outputs/aar/MyLIB.aar" just fine in Debug mode, but does not do so in Release mode. I see no errors, just "BUILD SUCCESSFUL" in the "Gradle Console" window but no Release Mode artifact.
There was a similar question raised here, and I'm getting the same behavior as #user1624552 mentions in the link:
"gradlew clean" followed by "gradlew aR" resultd in my AAR being created and correctly placed in the directory above. But using Android Studio and the "Release Mode" Build Variant does NOT create an AAR file.
Is there something configured in the Debug variant which is not configured in the Release variant?
Thanks, ALF
To get the aar, you can do the following
“
View/Tool Windows/Gradle
”, to open the gradle windowFrom gradle window, run assembly Gradle task by double-click on
My_Plugin_Android/:My_Plugin/Tasks/build/assemble
来源:https://stackoverflow.com/questions/34167898/why-wont-android-studio-create-my-aar-file-in-release-mode