How To Change API SDK Level In Android Studio

Basically, API level means the Android version. This defines for which version you are targeting your application and what is going to be the minimum level of android version in your application will run. For setting Minimum level and Maximum level android studio provides two terminologies.

minSdkVersion means minimum Android OS version that will support your app and targetSdkVersion means the version for which you are actually developing your application. Your app will be compatible with all the version of android which are falling between minimum level SDK and target SDK.


How to change API SDK level in Android Studio

For changing the API level in android we have two different Approaches, let’s check both one by one:

Approach 1 To Change SDK API Level in Android Studio:

Step 1: Open your Android Studio, and go to Menu. File >Project Structure.

project structure in Android Studio

Step 2: In project Structure window, select app module in the list given on left side.

Step 3: Select the Flavors tab and under this you will have an option for setting “Min Sdk Version” and for setting “Target Sdk Version”.

change api sdk level in Android Studio

You can check the name of version too in the drop down list while selecting the API level that makes the selection more clearer for anyone. Because sometimes remembering numbers is bit messy.

Step 4: Select both the versions and Click OK.


Approach 2 To Change API (Android Version) in Android Studio:

That will be pretty straight forward, but you need to stay very alert while making changes here.

Step 1: if you are project is opened in android option then select open Gradle Scripts > build.gradle(Module: app)

if you are in project View then click on your project folder > app > build.gradle

change sdk api level in build gradle android studio

Step 2: Here you have to change minimum and Maximum sdk level as per your requirement. check the below given code:

defaultConfig {
    applicationId "com.AbhiAndroid.Android.myProject"
    minSdkVersion 14
    targetSdkVersion 23
    versionCode 1
    versionName "1.0"
}

Step 3: Click on Sync Now and You are ready to go.

sync now change api sdk android studio

Note: If you are choosing the First Approach then you need not to make changes in Gradle. It will automatically update the gradle.

DOWNLOAD THIS FREE eBook!

This free eBook will help you master the learning of Android App Development in Android Studio!

20 thoughts on “How To Change API SDK Level In Android Studio”

  1. Hi,
    I have change the API level in Android studio but i want to know how i will change my apps API level which i made already in appmysite and how i will upload it in google play console with new API level?

  2. Hello pls i really need your help, i have sign a realesed and generated it already. But developer console said i should change the targested sdk level to 29 or 30 and now i have done it but the problem is that i cant generate a release for my edited app again… I think it is because i have done it once because i cant see the option to be able to generate it again. Pls HELP ME OOO

  3. If I start a new project and select API level 14 from the outset I have no problem developing in Android Studio, i.e., I must have API Level 14 SDK installed. However, if I simply want to update an existing project to use API 14 as minimum, I can t work out where in the Android Studio GUI IDE that I tell it to do this. James B Oct 19 ’13 at 11:42

  4. After changing android version of my app is not running on both Physical and Inbuilt emulators. Please suggest solution.

  5. Sir! I have my app built on ant build, rather than gradle system. Its target is api 14. But currently, The api level is updated to 27 in my android studio 2.3 How shall i downgrade it! I tried changing the sdkversion in the android.manifest xml file. But its not working! Please guide me !!

  6. Please sir, can you help me to edit apk file, i just installed app on my phone (my phone is running on Android 4.3)
    But, the app was set for sdktarget 23, and minsdk 14.
    I can use the app as well, but there is some feature tht i can not using it.
    So, i flashing marshmallow rom on my phone and installing the app again.
    The app work great very usefull, but im getting many bug in this rom, so i downgrade back my phone to 4.3.

    Can i use that app on my 4.3 phone like i was on 6.0?
    i have try edited manifest the apk file with ApkEditor and change minsdk to 14 and sdktarget to 15, but is not help and im getting error.
    I dont use Android studio because i dont have computer.

    Or, can anyone help me to change it please, i’ve been sent many request the app to many forum, but no one respond to me.

    Thank you
    Sorry for my english

    1. You will need to smartly code and debug for all versions. It is recommended you only target from Android 4.1 Jelly bean to latest.