如何捆绑依赖的资源,用我自己的AAR相处?

问题描述:

我要建一个使用包含资源依赖其他库的库。如果它的事项,即依赖关系是Facebook的SDK。

I'm building a library that uses another library which contains resources as a dependency. If it matters, that dependency is the Facebook SDK.

问题是,每当我加我的库作为依赖到另一个项目它不合并依赖的资源,我的AAR。

The problem is whenever I add my library as a dependency to another project it's not merging the dependency's resources to my aar.

为什么出现这种情况,为什么所有的资源都没有得到捆绑?

Why this happens and why all the resources are not getting bundled?

AAR的文件好好尝试一下包含传递依赖。

The aar file doens't contain the transitive dependencies.

这意味着你也必须添加这些依赖关系在你使用的库项目。

It means that you have to add these dependencies also in the project where you use the library.

另一种是发布库Maven仓库(公共或私营)。摇篮在这种情况下,与POM文件能够同时下载的依赖关系。

An alternative is to publish the library in a maven repository (public or private). Gradle in this case with the pom file is able to download also the dependencies.