0

I need to download the list of dependencies source jar files in all the modules in an Android project.

i tired the below code but it is giving error, as this works only for java projects and not working in android projects.

 task copyToLib(type: Copy) {
     into "libDownload"
     from configurations.compile
 }
 build.dependsOn(copyToLib)

configurations.compile is giving error, my project have build variants.

Ganapathy C
  • 5,989
  • 5
  • 42
  • 75

1 Answers1

0

Try to replace configurations.compile with configurations.runtime

task copyToLib(type: Copy) { into "$buildDir/output/libs" from configurations.runtime } build.dependsOn(copyToLib)

SofDroid
  • 5,450
  • 2
  • 13
  • 16
  • i am getting "Could not get unknown property 'runtime' for configuration container." – Ganapathy C Apr 19 '18 at 13:39
  • You should be using `configurations.runtimeClasspath` in place of `configurations.runtime` for any Gradle version that supports the `implementation` and `api` configurations. – Peter Ledbrook Apr 24 '18 at 09:20