如何在我的发行版中打包多个AAR [英] How to package multiple AAR's in my release aar

查看:334
本文介绍了如何在我的发行版中打包多个AAR的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们向客户发送一个android sdk(aar)文件。我们的代码在内部使用了两个第三方aar,我们在repo和gradle中都有它们在运行时引用它。我的问题是,如何将这些依赖关系发送给客户?如果我不想给他们那些第三方AAR的,我怎么能把这两个AAR嵌入我的AAR里面。直到现在,我们正在使用:
https://github.com/adwiv/android-



现在不行,所以寻找并行/更好的方法解决问题。
在Android Studio项目中使用模块依赖关系:
右键单击您的项目 - >打开模块设置或导航至视图 - >打开模块设置 - >点击'app'/ module-name - >选择'Dependencies'选项卡。在左下角,你应该找到一个'+'按钮来添加库依赖/ Jar依赖/模块依赖。
一旦您点击确定并将您的项目重新编译到aar文件中,您就会发现所有的依赖包括在内。

它也会自动更新gradle文件。

We ship an android sdk (aar) file to the customer. Our code internally uses two 3rd party aar's which we have in our repo and gradle references it at run time. My question is that how do I ship these dependencies to the customer? As in if I dont want to give them those 3rd party aar's, how can I embed those two aar's within my aar. Till now we were using: https://github.com/adwiv/android-fat-aar.

This doesn't work now, so looking for parallel/better ways of solving the problem.

解决方案

I use module dependencies in the Android Studio project: right click on your project -> Open Module Settings or navigate to View -> Open Module Settings -> click on 'app' / module-name -> select 'Dependencies' tab. On the left bottom, you should find a '+' button to add library dependency/Jar dependency/module dependency. Once you click 'OK' and rebuild your project into an aar file, you will find all the dependencies included.

It automatically updates the gradle file too.

这篇关于如何在我的发行版中打包多个AAR的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆