如何在另一个库中包含一个Android库模块? [英] How to include an Android library module in another library?
问题描述
我正在构建一个打包为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屋!