Android Studio appcompat library missing again - android

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

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.

The latest version is 24.1.0.
You can check it here: https://developer.android.com/topic/libraries/support-library/revisions.html

Change to
compileSdkVersion 23
buildToolsVersion "23.0.3"
and change
compile 'com.android.support:appcompat-v7:22.2.1'
to
compile 'com.android.support:appcompat-v7:23.4.0'
if you want to target sdk 22 add/change
defaultConfig {
//
minSdkVersion 16
targetSdkVersion 22
//
}
Although latest version is 24.1.0 but for that you have to update again from sdk-23 to sdk-24

Related

Android targetSDKVersion 19 but where is support library

I have
targetSDKVersion 19
and trying to use
compile 'com.android.support:recyclerview-v7:19.0.+'
is giving me an error failed to resolve ...
When I go to SDK Manager, I can only see Android Support Library rev 23.1.1 available for download.
If I use that version 23, then I have the error this support library should not use a different version ...
My searches only bring up the fact I need to install same version of support library as I have targetted SDK - however as above, I can't find it ?
The target SDK version and the version of the library must match. So rather than using the support library in version 19, upgrade your targetSDKVersion to 23 and also use the support library in version 23.1.1.
If that doesn't work out of the box, try installing the google support repository from the SDK Manager.
Try using this
compile 'com.android.support:recyclerview-v7:23.1.0'
and change your gradle file
minSdkVersion 19
targetSdkVersion 23

Android Studio with compileSdkVersion 16 don't compile on Mac

I have used linux for a while, and now I'm on Mac.
I use Android Studio and I want to compile my old projects exported from Eclipse on linux. I have "repaired" gradle configuration to work on Mac, but I have some issues with compileSdkVersion setted on 16 (like I used on linux). My project give me some errors about appcompat-v7
Image link: (not sufficient points to post image) http://i.stack.imgur.com/uWj7f.jpg
When I set a bigger compileSdkVersion, it gives me about 5 errors, but I want to compile like on linux with version 16. What I need to do?
Regards!
To use AppCompat 23.0.1, you must compile with API 23.
Note that compileSdkVersion does not actually change any behavior in your app - that is what targetSdkVersion does.
Check your compilesdk version. It needs to be >= to the support library version. E.g if you use appcompat version 7.23, then use compileSdkVersion 23

How do I Know My System Available Gradle buildToolsVersion

This issue is encountered when my Android Studio project is copied by others, but they can'r run it directly.
The error message is failed to find build tools versions XX.X.X.
Then how do they know what the version should be changed for their own system?
Or is there a better way to set the buildToolsVersion "XX.X.X" to widely suit others in build.gradle?
Also the same question for compileSdkVersion, how do I know the version(s) available in my system?
Is there a gradle(not limited) script to find out the available version?
On Linux you'll find your BuildTool Versions on :
$ANDROID_HOME/build-tools/
Look at your build.gradle (Module:<app-name>) file. There should be a buildToolsVersion line in that file. Make sure that you and others have that version of the build tools installed.
Also make sure that the version of build tools is still available form the SDK manager.
I had this issue when working on a friend's project. He was using a version of build tools that I could not get anymore. I think this is because things are updated and replaced.
We fixed this by both installing the most current version of build tools.
I have also ran into this issue when I upgraded Android Studios and the version of build tools was no longer available.
For the compileSdkVersion you can goto Tools > Android > SDK Manager. This will pull up a window that will allow you to manage your compileSdkVersion and your buildToolsVersion.
You can also select the link at the bottom left (Launch Standalone SDK Manager) this will give you a little bit more information.
You can check the available versions from the official android developer's link : https://developer.android.com/studio/releases/build-tools.html
Then choose the corresponding version (generally the latest) based on your compileSdkVersion and targetSdkVersion

How to get Android Support library 20 revision in sdk

I'm using Android Studio. Everything was going good but I updated Android support library to 22 revision and my application UI is changed and In some Activities app is crash.
I want to downgrade the version of Android support library from 22 revision to 20 revision in SDK so I uninstalled Android support library but when I install it every time 22 revision is installed.
How can I install 20 revision of Android support library?
You can check inside the sdk folder in your pc.
androidsdk\extras\android\m2repository\com\android\support
For each support library you will find all versions available.
compile 'com.android.support:support-v4:19.1.0'
compile 'com.android.support:support-v4:20.0.0'
compile 'com.android.support:support-v4:21.0.3'
Pay attention.
If you use the v20+, you have to use the api 21+ to compile your project.
In your app's module there is a build.gradle file. Inside that you will see something like:
compile 'com.android.support:support-v4:xx.x.x'
This is how you dictate which support library is used when compiling the app. You will need to have the version you choose installed in your SDK manager.

Why i can't compile my android project with other APIs

i want to build an android project for API 19 so i choose this API to compile with, but when eclipse create the projects its tells me that some ressources are not found and the R class is not generated. the only way to avoid this errors is to compile with API21
So why i can not use my API 19 in compilation ??
THNKS for all
Compile SDK Version can and should always be set to the latest SDK released. It is target SDK version that you should set to the latest version you've tested your app on.
Eclipse by default includes AppCompat - the part of the Support Library which ensures a consistent look and feel across all API versions v7+ and the newest version, revision 21, compiles against API 21.
So why i can not use my API 19 in compilation ?
be sure to have the api installed:
Window -> Android SDK Manager

Categories

Resources