The android.com site about snackbars (https://developer.android.com/reference/android/support/design/widget/Snackbar.html) says: added in version 22.2.0
So do I need to check for Api 22 or 23?
You need to add support for Snackbar in the gradle to work for lower APIs.
Add the following in dependencies of gradle and sync it:
compile 'com.android.support:design:22.2.0'
You do not need to check for version.
The Android Design Support Library supports it for Android 2.1 and higher (API 7).
Related
I was developed with AndroidX and it is a wonderful library, I run my demo app in my smartphone with Android 6, but I have a question, does AndroidX support Android 5.0 and lower?
It depends on the specific library, but on the whole the current set of androidx libraries support back to API Level 14 (Android 4.0).
With Android Studio 3.2 and higher, you can quickly migrate an existing project to use AndroidX by selecting Refactor > Migrate to AndroidX from the menu bar.
Ref: Migrate an existing project using Android Studio
You read more stuff from there base on your tpoic!
I am compiling for SDK version 26. How can I find out what are the newest support libary versions for the target version?
In the official doc you can find all the releases.
Otherwise you can browse the new google maven repo.
You can always use + to use latest version like:
compile 'com.android.support:appcompat-v7:26.+'
It will use the highest version that starts with 26.
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
I am developing an app using Android Studio and AppCompat. I cannot seem to compile the Android support library to make a TabLayout. I get the error
"Could not find com.android.support:design:23.2.0".
Did you add the package in the Gradle file?
You need to have the Android Support Repository via the SDK manager.
Make sure latest version matches targetSdkVersion
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