How To Change Minimum Sdk Version In Android Studio

When you use android widget in layout xml or java code, you may encounter error messages like Call requires API level 23 (current min is 17): . This means your current android minimum sdk version is 1.7, which is too low to use this widget. You need to change it to 23. This article will show you how to change it in android studio.

android sdutio min sdk version issue

First, we should know these two terms about android sdk version.

  1. minSdkVersion : This is the minimum versio of android os that your app support.
  2. targetSdkVersion : This is the android os version which your app actually executed with.
  3. You app should compatible with all the android os versions between minSdkVersion and targetSdkVersion.

1. Change Android SDK Version In Android Studio.

There are two method that can change android sdk version in android studio.

1.1 Change in build.gradle File.

  1. Select Project in Project view.
  2. Edit app / build.gradle file.
  3. Change minSdkVersion and targetSdkVersion in right panel.
    change android min sdk version in build.gradle

1.2 Change In Project Structure Dialog.

  1. Click android studio menu ” File —> Project Structure “.
    android studio file project structure
  2. In Project Structure dialog, select app in Modules list. Select Flavors tab in right panel, then you can select your desired android Min Sdk Version and Target Sdk Version.
    android project structure dialog
  3. Click OK to save the selection.
  4. Click ” Build —> Rebuild Project ” menu item to rebuild the android project.
  5. This time the build.gradle file will be changed by android studio automatically.
(Visited 4,961 times, 33 visits today)
READ :   How To Set Android SDK Path In Windows And Mac

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.