简体   繁体   English

在AAR中包含/ libs /文件夹

[英]Include /libs/ folder in aar

Feel like Im going mad here - this must be so simple! 感觉我在这里疯了-这一定很简单!

I have an android aar which I have built from gradle assembleRelease and also using the maven-publish plugin. 我有一个我从gradle assembleRelease构建的android aar,也使用了maven-publish插件。 I thought that /libs/ was included by default but evidently not. 我认为/ libs /是默认包含的,但显然不是。

Android tools site shows its an optional include Android工具网站显示了其可选的包含

http://tools.android.com/tech-docs/new-build-system/aar-format http://tools.android.com/tech-docs/new-build-system/aar-format

but for the life of me I don't see where this is configured. 但对于我的一生,我看不到它的配置位置。

I have asked a related Q Include folder in Gradle artifact but I dont see this as a duplicate as thats a generic gradle question really whereas this is aar specific and may be solved outside of gradle. 在Gradle工件中询问了一个相关的Q Include文件夹,但我不认为这是重复的,因为那确实是一个通用gradle问题,而这是特定于aar的,可以在gradle之外解决。

Edit I have also asked on the Gradle forum 编辑我也在Gradle论坛上问过

The aar packages local libraries in libs/ so you need to have local jar dependencies. aar在libs/打包本地库,因此您需要具有本地jar依赖项。

dependencies {
  compile fileTree(include: ['*.jar'], dir: 'libs')
}

When the maven plugin runs uploadArchives then it will create a pom file that tells maven or gradle what dependencies your aar needs. maven插件运行uploadArchives ,它将创建一个pom文件,该文件告诉mavengradle您的aar需要什么依赖关系。 Gradle will handle downloading the jar files and placing them in your class path for the build. Gradle将处理下载jar文件并将其放置在构建的类路径中。

I commented on your other question as well 我也评论了你的其他问题

*reference: https://maven.apache.org/pom.html#Dependencies *参考: https : //maven.apache.org/pom.html#Dependencies

*=gradle is backed by maven for dependency management so artifacts available to maven are also available to gradle and vice versa * = gradle由maven支持以进行依赖关系管理,因此maven可用的工件也可以进行gradle,反之亦然

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 将Gradle构建模块作为.aar放置在另一个模块的libs文件夹中 - Gradle build module as .aar and put in another module libs folder 使用Android Studio 3.0在输出文件夹中不再创建AAR库 - AAR libs no longer created in the output folder with Android Studio 3.0 Android AAR包含jar依赖资源文件夹 - Android aar include jar dependency resources folder 我可以在/ libs文件夹中发布包含另一个AAR文件的AAR文件吗? - Can I publish AAR file is included another AAR file in /libs folder? 有没有办法从项目 libs 文件夹中的另一个 aar 文件访问一个 aar 文件的方法 - Is there any way to access methods of one aar file from another aar file in project libs folder 包括aar到aar - Include aar into aar Gradle包含一个在libs文件夹中的所有文件夹(编译fileTree整个libs文件夹)编辑:为每个风格设置sourcedir这样的文件 - Gradle include all in a flavors libs folder (Compile fileTree whole libs folder)Edit: set sourcedir per flavor for so files Maven发布aar嵌入jar库 - Maven publish an aar embedding jar libs 使用Java或Kotlin在libs中搜索aar文件名 - search an aar file name in libs with java or kotlin 如何从Main访问lib中的aar文件 - How to access aar file, in libs, from Main
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM