Makketronix Makketronix - 4 months ago 22
Android Question

Android Studio appcompat library missing again

I have installed Android SDK tools 22.0.1 and 23.0.3
I want to target SDK version 22.

After chasing previous posts here, I found that people got this to work

compile 'com.android.support:appcompat-v7:22.2.1'


However, I am still getting:

Failed to resolve com.android.support:support-v4:22.2.1


So, I add version 4, then I get same error, twice (below each other)

Which is the latest appcompat support library? Where do you find out the latest version?

This is really frustrating...

Thanks

Answer

I have installed Android SDK tools 22.0.1 and 23.0.3

That is irrelevant with respect to using appcompat-v7.

I want to target SDK version 22

Assuming that you mean that you want your targetSdkVersion to be 22, that too is irrelevant with respect to using appcompat-v7.

Which is the latest appcompat support library?

Right now, it is 24.1.0.

Where do you find out the latest version?

In your specific case, go to the Android SDK installation on your developer machine. In there, go to extras/android/m2repository/com/android/support/. In there, you will see directories with the names of all the pieces of the Android Support library (e.g., appcompat-v7/). If you go into any of those, you will see the versions that are available to you.

Now, what is disconcerting about your error messages is that you are getting a failure on support-v4, for a version requested by an appcompat-v7 that apparently is found (otherwise, your error would be for appcompat-v7). This suggests that you do not have all of the Android Support library pieces, perhaps due to a failed installation of the Android Repository from the SDK Manager.

What if I want to compile with SdkVersion 22?

That is not a particularly good idea for new development (vs. maintaining some legacy app). But, if that is what you want, you need to choose Android Support library artifact versions in the 22 series. On my machine, it looks like 22.2.1 is the latest of those.

Comments