Reputation: 97
I changed Target SDK Version from 30 to 31 and Min SDK Version from 19 to 22. In build.gradle, the minSdkVersion, targetSdkVersion and targetSdk change accordingly except for minSdk. It is still 19.
android {
compileSdk 31
defaultConfig {
applicationId "com.example.studentsacademicmanagementappsama"
minSdk 19
targetSdk 31
versionCode 1
versionName "1.0"
vectorDrawables.useSupportLibrary = true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
targetSdkVersion 31
minSdkVersion 22
}
}
What is the difference between minSdkVersion, targetSdkVersion and minSdk, targetSdk?
Should I change minSdk to 22 or ignore it?
Upvotes: 5
Views: 2803
Reputation: 23381
As of the Android Gradle Plugin released in July 2021, you can use either minSdk or minSdkVersion, targetSdk or targetSdkVersion, compileSdk or compileSdkVersion. Why they did this, I'm not sure.
More details on this better answer over here: https://stackoverflow.com/a/67251145/467509
Upvotes: 4
Reputation: 120
There is no such thing named minSdk , targetSdk and compileSdk in build.gradle. you should config your app compatibility like this :
android {
compileSdkVersion 30
buildToolsVersion "30.0.3"
defaultConfig {
applicationId "com.app.test"
minSdkVersion 21
targetSdkVersion 30
versionCode 1
versionName "1.0.0"
}
}
Upvotes: -3