简体   繁体   English

Android Studio AAR模块

[英]Android studio aar modules

Been having some trouble understanding the concept of aar modules in android studio (after being with Eclipse for many years). 在理解android studio中aar模块的概念时遇到了一些麻烦(在Eclipse中工作了很多年)。

Say i import aar file as a module to my project with "app" being the application. 说我将aar文件作为模块导入到我的项目中,其中“ app”是应用程序。

  1. Can the app use code which is in the module jars or only use source in code in that aar? 应用程序可以使用模块jar中的代码,还是仅使用源代码中的源代码?

  2. If i use activities which are in the aar in my "app" do i need to add them in the "app" manifast? 如果我在“应用程序”中使用了活动中的活动,是否需要将其添加到“应用程序”中?

  3. If i have a compiled jars in the "app" that are the also compiled in the aar can it cause trouble? 如果我在“ app”中有一个已编译的jar,并且也在aar中进行了编译,会引起麻烦吗?

  4. Jars which are used in the aar should also added to the "app" 在aar中使用的罐子也应添加到“ app”中

Thanks for helping 感谢您的帮助

I have an example for packaging the dependencies into AAR file. 我有一个将依赖项打包到AAR文件中的示例。 Just make two extra tasks for copy 3rd JARs into ./build/intermediates/bundles/$BUILD/libs/ path, before gradle bundling the libs/ into AAR. 在将libs /捆绑到AAR中之前,只需完成两个额外的任务即可将第三个JAR复制到./build/intermediates/bundles/$BUILD/libs/路径中。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM