How to include dependencies when publish the library to bintray in android
Asked Answered
P

1

6

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.

Priming answered 12/1, 2017 at 19:47 Comment(1)
I'm an iOS engineer. When we use cocoa pod, it downloads everything its dependency. But I can't do it in android.Priming
K
2

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;
}
Klaraklarika answered 12/1, 2017 at 21:33 Comment(1)
This worked for me. Thanks. I tried this solution but I got failed.Priming

© 2022 - 2024 — McMap. All rights reserved.