0

I have a maven Android project which depends on version 21.0.3 of compatibility-v4 and compatibility-v7-appcompat. I can only see how to use maven-android-sdk-deployer to obtain the latest versions of these libraries (currently 22.0.1), however they are incompatible.

How can I obtain version 21.0.3 of these libraries and use them within a Maven build?

funkybro
  • 8,432
  • 6
  • 39
  • 52

1 Answers1

0

Use Gradle dependencies:

dependencies {
    com.android.support:appcompat-v7:21.0.3 // current is 22.2.0
}

Some Other previous versions:

  • 22.0.0
  • 21.1.1
  • 21.1.0
  • 21.0.3
  • 21.0.0
  • 19.1.0
  • 19.0.2
  • 19.0.1

You may need to already have versions downloaded but you definitely need to download them through the Android SDK manager:

https://developer.android.com/tools/support-library/setup.html#download

See the support library docs here:

https://developer.android.com/tools/support-library/features.html

After making sure you have the correct dependencies locally, you can use the Android SDK repo with your project's pom.xml:

<repositories>
    <repository>
        <id>android-support</id>
        <url>file://${env.ANDROID_HOME}/extras/android/m2repository</url>
    </repository>
</repositories>
    ......
<dependency>
    <groupId>com.android.support</groupId>
    <artifactId>support-v4</artifactId>
    <version>19.0.1</version>
</dependency>

Source: https://stackoverflow.com/a/22602712/950427

Community
  • 1
  • 1
Jared Burrows
  • 54,294
  • 25
  • 151
  • 185
  • "however they are incompatible" is why I want to do that. I am using Maven, not Gradle. Even if I were though, I would need to have it installed via the SDK manager, right? And I cannot see 21.0.3 available in the SDK manager any more. – funkybro Jul 14 '15 at 17:28
  • You could never see the "21.0.3". You just download the repository here: https://developer.android.com/tools/support-library/setup.html#download. After specifying the version, you will download it. Once again, you should be using Gradle, either way they are Maven dependencies under the hood. – Jared Burrows Jul 14 '15 at 17:31
  • Thanks. But my question is really around how to use android-maven-sdk-deployer to achieve this. Sadly that is too long to use as a SO tag. – funkybro Jul 14 '15 at 17:33
  • What is incompatible? You can still use my answer setup your `pom.xml` to use your local repo: http://stackoverflow.com/a/22602712/950427. – Jared Burrows Jul 14 '15 at 17:37
  • The app was relying on a class in an `android.support.v7.internal` package which has now moved and changed name. I'm not sure that is relevant to my question though. I want to know how I can get Maven to build the app without any code changes. – funkybro Jul 14 '15 at 17:46
  • Update your code to use the latest libraries so you can maintain it. I have answered your original question. – Jared Burrows Jul 14 '15 at 17:47