I want to change the minimum SDK version in Android Studio from API 12 to API 14. I have tried changing it in the manifest file, i.e.,
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="18" />
and rebuilding the project, but I still get the Android Studio IDE throwing up some errors. I presume I have to set the min SDK in 'project properties' or something similar so the IDE recognizes the change, but I can't find where this is done in Android Studio.
For the latest Android Studio v2.3.3 (October 11th, 2017) :
1. Click
View
on menu bar2. Click Open Module Settings
3. Open
Flavors
tab4. Choose Min
Sdk
version you need6. Click OK
Changing the minSdkVersion in the manifest is not necessary. If you change it in the gradle build file, as seen below, you accomplish what you need to do.
When you want to update your minSdkVersion in an existent project...
build.gradle(Module: app)
- Make sure is the one under Gradle Script and it is NOTbuild.gradle(Project: yourproject)
.An example of build.gradle:
After updating the build.gradle's
minSdkVersion
, you have to click on the button to sync gradle file ("Sync Project with Gradle files"). That will clear the marker.Updating manifest.xml, for e.g. deleting any references to SDK levels in the manifest file, is NOT necessary anymore in Android Studio.
If you're having troubles specifying the SDK target to Google APIs instead of the base Platform SDK just change the
compileSdkVersion 19
tocompileSdkVersion "Google Inc.:Google APIs:19"
In
build.gradle
changeminSdkVersion 13
tominSdkVersion 8
Thats all you need to do. I solved my problem by only doing this.In Android studio open build.gradle and edit the following section:
here you can change minSdkVersion from 12 to 14