如何在另一个库中包含一个Android库模块? [英] How to include an Android library module in another library?

查看:89
本文介绍了如何在另一个库中包含一个Android库模块?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在构建一个打包为aar并分发给第三方开发人员的Android库.

I am building an Android library that is packaged as an aar and distributed to 3rd party developers.

结构非常简单:

项目 -图书馆A --- libraryB

project ---libraryA ---libraryB

libraryA需要libraryB,这就是为什么它在gradle文件中有这个东西:

libraryA requires libraryB, which is why is has this in its gradle file:

compile project(':libraryB')

settings.gradle有

And settings.gradle has

include ':libraryB', ':libraryA'

但是,如果我以aar的形式构建项目,则它仅包含libraryA.我想念什么?

But if I build the project as an aar it only includes libraryA. What am I missing?

我阅读了对此的回复:

I read the responses to this: Android Studio how to package single AAR from multiple library projects?

这仍然不可能吗?我认为将您的代码分成多个模块不是一个坏习惯吗?

Is this still not possible? I would assume that splitting up your code into multiple modules is not bad practice?

推荐答案

您可以尝试在此处发布的fat-aar.gradle脚本: https://github.com/adwiv/android-fat-aar

You can try fat-aar.gradle script published here: https://github.com/adwiv/android-fat-aar

这篇关于如何在另一个库中包含一个Android库模块?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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