在Android中将库发布到Bintray时如何包含依赖项 [英] How to include dependencies when publish the library to bintray in android
问题描述
我是刚开始在android中发布自己的库. 我创建了自己的库并将其上传到Bintray.我的图书馆依赖于几个第三方图书馆.当我看到pom.xml文件时,有依赖项信息. 但是,当我将库添加到测试项目gradle时,它没有导入其依赖项.因此,我必须手动添加它以测试项目的gradle.添加库以测试项目的gradle时,如何自动导入依赖项模块? 有没有人可以解决这个问题?我的库位于二进制文件的Maven存储库中. 我现在在这个领域找到专家.
I'm new to publish own library in android. I created my own library and uploaded it to bintray. My library depends several third party libraries. When I see pom.xml file, there are dependency information. But when I add my library to test project gradle, it didn't import its dependencies. So I had to add it manually test project's gradle. How can I import dependency module automatically when I add my library to test project's gradle? Is there anyone that can solve this? My library is on binary's maven repository. I find expert in this scope now.
推荐答案
You need to include your library as a transitive dependency. Your build.gradle
should have something like this:
compile('com.example.your.library:0.1.0@aar') {
transitive = true;
}
这篇关于在Android中将库发布到Bintray时如何包含依赖项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!