Can i set targetSDK lesser than buildToolsVersion & compileSdkVersion - android

I have upgraded google-play-services to 15.0.0, that uses android.support:26.1.0, so i am planning to upgrade compileSdkVersion and buildToolsVersion to version 26.
But there are some external libraries(.aar libraries) that requires targetSdkVersion to be set to version 25.
So if i set compileSdkVersion to 26 and buildToolsVersion to "26.0.0" and keep targetSdk to version 25, then what will happen

AFAIK, targetSdkVersion should be <= compileSdkVersion. As the Android Framework Developer said in this blog, ideally to have a steady state this should be the relationship of the compileSdkVersion, minSdkVersion, and targetSdkVersion:
minSdkVersion (lowest possible) <=
targetSdkVersion == compileSdkVersion (latest SDK)
Hope this helps.

Related

android app Frozen after updating latest gradle

After updating latest android gradle 7.1.2 and compileSdkVersion 32 app Frozen like in the picture
android {
compileSdkVersion 32
buildToolsVersion "30.0.3"
defaultConfig {
applicationId "com.bad.good"
minSdkVersion 16
targetSdkVersion 32
versionCode 33
versionName "4.3"
Finally I found it. one of the old library Couse this app Frozen. After removing that library it fixed ..

Which compileSdkVersion should I use in my android project?

I'm using latest dependencies in my project. My minSdkVersion is set as 15 and targetSdkVersion is 26. Which build tools and compileSdkVersion should I use so that the app can be run even in Adnroid 5.
Here are the details-
compileSdkVersion 28
buildToolsVersion '28.0.3'
defaultConfig {
applicationId "com.app.shoppingbull"
minSdkVersion 15
targetSdkVersion 26
versionCode 1
versionName "1.0"
}
Will these work fine in all devices or I have to reduce the CompileSdkVersion?
Always follow this,
minSdkVersion <= targetSdkVersion <= compileSdkVersion
Because, when you develop app always target the latest SDK so that you provide the latest features of Google to your user.
According to source.android.com if you want to make your App can be run in Adnroid 5 and newer, you should set the minSdkVersion to 21
tip: don't make your minSdkVersion lower than 21
Your application will work in the range of minSdkVersion and targetSdkVersion api level.
You should target your app to the latest version of Android SDK version (see SDK Platform release notes) to make sure you've covered all the Android version. It also force you to check if your code is working correctly with the latest version.
So, change your app build.gradle to something like this:
compileSdkVersion 28
buildToolsVersion '28.0.3'
defaultConfig {
applicationId "com.app.shoppingbull"
minSdkVersion 15
targetSdkVersion 28 // latest stdk
versionCode 1
versionName "1.0"
Ideally, your targetSdkVersion and compileSdkVersion should be the same, and the latest. That's 28 at the current time of writing.
minSdkVersion dictates the minimum version your app will support, so having a compile/target of 28 will still let you run on 15.

difference between compileSdkVersion and buildToolsVersion in android studio..?

hiii
i'm new in android development.Can anyone tell me what is compileSdkVersion and
buildTollsVersion defined in build tools version.
compileSdkVersion 24
buildToolsVersion "23.0.3"
is this a correct definition..?
if not then what it will cause..?
please help
thank you
compileSdkVersion is the API version of Android that you compile against.
buildToolsVersion is the version of the compilers (aapt, dx, renderscript compiler, etc...) that you want to use. For each API level (starting with 18), there is a matching .0.0 version.

Running different version in Android library versus your app

I have the following in my main app:
...
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
minSdkVersion 8
targetSdkVersion 23
versionCode 19
versionName "1.0.5"
}
...
In a library I use, this is defined:
...
android {
compileSdkVersion 17
buildToolsVersion "19.1.0"
defaultConfig {
minSdkVersion 7
targetSdkVersion 7
}
...
I have uppgraded my API target etc. in my app. The library I have, use the same API target etc. (haven't changed the code). If I upgrade my app and use libraries, can I leave them as is? Or do I need to sync the two in respect with compileSdkVersion, buildToolsVersion, minSdkVersion and targetSdkVersion?

L preview: Call requires API level 21 (current min is 20)

I am trying L and got an API level error. I have set the current min to 'L' but it seems Android Studio think it's 20.
How to fix it?
I updated Android Studio 0.6.1 to 0.8.0 and the error disappeared.
build.gradle looks exactly the same:
compileSdkVersion 'android-L'
buildToolsVersion '19.1.0'
defaultConfig {
applicationId 'com.prt2121.tryl'
minSdkVersion 'L'
targetSdkVersion 'L'
versionCode 1
versionName '1.0'
}
I don't think my question is a duplicate but thanks anyway.
Change
android {
compileSdkVersion 'android-L'
buildToolsVersion '19.1.0'
to
android {
compileSdkVersion 21
buildToolsVersion '21.0.2'
Note android-L is in single quotes but 21 isn't. 21 is an integer and not a string.

Categories

Resources