How to get library dependency version used in Gradle file from android Programmatically?

Viewed 140

I'm currently stuck at one Problem regarding Gradle dependancy. I'm implementing application where I need to use various Third-party libraries to get work done & they are working great but currently situation is that I need their version numbers used in Gradle file.

I've found this question most closely related to my problem Is there a way to list all gradle dependencies programmatically? But its printing dependency tree using Gradle task using Gradle console so, is there anyway we can get this using Android code?

Also I would like to explain my question in simpler terms , How can I get retrofit2 library version Programmatically ? enter image description here

0 Answers
Related