18

In almost every Android app we need a couple of library projects like ABS, HoloEverywhere, etc. Most of these are in Maven Central, which is good. What is bad is, most of them depend on the support library and naturally point to the outdated (I mean very buggy) version in Maven Central.

We are currently maintain our own repositories with custom versions of Android (using the Maven Android SDK deployer) and each library (fetched from git and with adjusted maven dependency). Will there be an easier way of doing this, using the new Gradle based build system (like overwriting dependencies of aar projects)?

Jonik
  • 80,077
  • 70
  • 264
  • 372
stoilkov
  • 1,686
  • 1
  • 11
  • 18

2 Answers2

39

We will provide artifact versions of the support libraries. Stay tuned.

Edit: The artifacts are now available. You have to download "Android Support Repository" in your SDK. The gradle build system will automatically use this as a local Maven repository.

There are 3 artifacts in it right now:

com.android.support:support-v4:21.0.0
com.android.support:support-v13:21.0.0
com.android.support:gridlayout-v7:21.0.0
com.android.support:appcompat-v7:21.0.0
Jared Burrows
  • 54,294
  • 25
  • 151
  • 185
Xavier Ducrohet
  • 28,383
  • 5
  • 88
  • 64
  • Thanks Xavier, this will be a big help for us. We will also love the new gradle feature to start multiple emulators. The current common setup with matrix builds in jenkins using the android emulator plugin is far from perfect. – stoilkov May 29 '13 at 15:17
  • 1
    This works great when my project depends on support library. But, when I do `gradle assemble` when using a 3rd party AAR library from Maven Central repo, which depends on _support-library-v4 r18_, I get an error: `Could not find com.google.android:support-v4:r18. Required by: com.example:app-project:unspecified > com.example:lib-project:1.0.0-SNAPSHOT` More details about this issue are available [here](http://stackoverflow.com/questions/18559660/android-gradle-build-with-maven-dependency-which-depends-on-support-library-r18). – Nimrod Dayan Sep 11 '13 at 08:06
  • While this update is technically correct, it will only work if the android or android-library Gradle plugins are used. – Nick Davis Sep 17 '13 at 16:10
4
apply plugin: 'android-library'

dependencies {
    compile 'com.android.support:support-v4:21.0.0'
}
Crossle Song
  • 10,104
  • 2
  • 29
  • 38