Reputation: 2102
I've developed an Android application for a device with Android 7.0.
Now I have to test this application with an older device that has Android 4.2.2.
Android Studio shows the following error when trying to deploy: minSDK(API 23) > deviceSDK(API 17).
How I can change the API of my project?
Upvotes: 1
Views: 65
Reputation: 473
use minSdkVersion to specify the oldest android version your app can support. For example, if you set your minSdkVersion to 21(Lollipop) then you won't be able to run the app on any phone with android os older than 5.0. You can find the option to change it in your module level gradle file.
https://source.android.com/setup/start/build-numbers for more details
P.S - I intentionally didn't answer your question.
Upvotes: 0
Reputation: 75788
Read android:minSdkVersion
.
An integer designating the minimum API Level required for the application to run. The Android system will prevent the user from installing the application if the system's API Level is lower than the value specified in this attribute.
Open Module level build.gradle
and Set
defaultConfig {
minSdkVersion 17
targetSdkVersion //
versionCode //
versionName "//"
}
After that, Clean-Rebuild-Run
.
Upvotes: 2
Reputation: 110
You need to go to build.gradle
and change the minSdkVersion
to 17 or lower
defaultConfig {
..
minSdkVersion 14
targetSdkVersion 26
versionCode 1
versionName "1.0"
..
..
}
Then click on Sync Now
This might require downloading missing packages and some changes in your app to support the older version of android
Upvotes: 0