0

At our company, we have started modularizing our android projects and each has several dependencies. We use JFrog artifactory to host our aar files. Here is the code:

Library A:

compile "com.google.firebase:firebase-crash:$googlePlayServices"
compile "com.google.firebase:firebase-core:$googlePlayServices"
compile "com.squareup.retrofit2:retrofit:$retrofit"

The following does not work. I have also tried removing "@aar" but still nothing. Main Projects:

compile ('com.sample.librarya:librarya:0.0.1@aar'){
    transitive = true
}

and hence I have to add retrofit dependencies to the main app again.

I have done a lot of research and read a lot of SO questions but none of them help hence this question. I also have all dependencies on LibraryA listed in its pom.xml file.

Ariel
  • 3,406
  • 14
  • 17
android_eng
  • 1,370
  • 3
  • 17
  • 40
  • 1
    Try to add `compile "com.sample.librarya:librarya:0.0.1@pom"` – MartinTeeVarga Feb 21 '17 at 00:36
  • Thank you. That worked. Only thing is that first I put "@pom" tp download the pom and the had to replace it with "@aar" to use the aar file. How to download both aar and the pom file. – android_eng Feb 21 '17 at 02:13

1 Answers1

2

Add both following dependencies:

compile ('com.sample.librarya:librarya:0.0.1@pom')
compile ('com.sample.librarya:librarya:0.0.1@aar')

The first will download the pom and add all it's transitive dependencies on classpath. The second will download the aar.

MartinTeeVarga
  • 10,478
  • 12
  • 61
  • 98