Android targetSDKVersion 19 but where is support library - android

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

Related

Developing for older Android version

I want to develop for Android 23 (Marshmallow). I created a new project, modify/remove everything and only use these as my project's components.
Android SDK Build Tools 23.0.3
Android SDK Platform 23
Android Gradle Plugin 2.1.3
Gradle 2.14.1
Target SDK version: 23
Minimum SDK version: 23
Compile SDK version: 23
JDK 1.8.0_211
I manage to get it running on my Android 28 (Oreo) device, but I read it somewhere that the later version of SDK, Build Tools and Gradle provides better security. Should I use all of the latest tools? if so, can I use the latest tools to develop only for Android 23?
Because when I installed Android Studio, it prompt me to target my SDK to 26 since Google Play requires developers to do so. Please teach me the best practice to develop for older Android version. Thank you in advance.
I think you are not aware of what targetSDKversion means.
Let me clarify you. When Google releases a new version of android it brings new features, security and performances improvements. When you configure targetSDKversion then the user can benefit from these improvements while your app still runs on the older version.
For more information:
https://developer.android.com/distribute/best-practices/develop/target-sdk
You do not develop for a single SDK version.
You develop for a RANGE of versions, going from MinimumSDK (yours would be 23) to TargetSDK (minimum of 26 to get into the Play Store, but always best to go the latest possible)
https://learn.microsoft.com/en-us/xamarin/android/app-fundamentals/android-api-levels?tabs=windows

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
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

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 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