[英]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我创建了一个非常简单的“Android 库”模块,只有一个类,它在调试发布 build/output/library-debug.aar 时构建良好
But, when I switch to release, even though it says build successful, the aar is not there.但是,当我切换到发布时,即使它说构建成功,aar 也不存在。
The Android Studio project only has this library module. Android Studio 项目只有这个库模块。
Thanks for advance.感谢您的提前。
To get the aar, you can do the following要获得 aar,您可以执行以下操作
1) “View/Tool Windows/Gradle”, to open the gradle window 1) “View/Tool Windows/Gradle”,打开gradle窗口
2) From gradle window, run assembly Gradle task by double-click on My_Plugin_Android/:My_Plugin/Tasks/build/assemble 2) 在 gradle 窗口中,双击 My_Plugin_Android/:My_Plugin/Tasks/build/assemble 运行组装 Gradle 任务
Then the release and debug aars are outputed.然后输出release和debug aars。
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. aar 文件将在 finder 窗口的“build/outputs”文件夹中生成。
Ensure that the following line is there in your build.gradle
file确保您的build.gradle
文件中有以下行
apply plugin: 'com.android.library'
Set up your project as an Android library
.将您的项目设置为Android library
。
In build.gradle
file: plugin: 'com.android.library'
在build.gradle
文件中: plugin: 'com.android.library'
You can see the output in: build/outputs/aar/[your module]
.您可以在以下位置看到输出: build/outputs/aar/[your module]
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.