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.
As now Android Studio is stable, there is an easy way to do it.
PS: Though this question was already answered but Android Studio has changed a little bit by its stable release. So an easy straight forward way will help any new answer seeker landing here.
As well as updating the manifest, update the module's
build.gradle
file too (it's listed in the project pane just below the manifest - if there's nominSdkVersion
key in it, you're looking at the wrong one, as there's a couple). A rebuild and things should be fine...For me what worked was: (right click)project->android tools->clear lint markers. Although for some reason the Manifest reverted to the old (lower) minimum API level, but after I changed it back to the new (higher) API level there was no red error underline and the project now uses the new minimum API level.
Edit: Sorry, I see you were using Android Studio, not Eclipse. But I guess there is a similar 'clear lint markers' in Studio somewhere and it might solve the problem.
What worked for me:
I had renamed one of my imageViews and was still referencing the old imageView name in a textView later on:
In my code I changed:
to
And rebuilt the project. I don't know why this fixed the resource linking problem, but it fixed it.
In android studio you can easily press:
android studio
, then press on app first. Then, continue with step three as follows.You can also change the
versionCode
of your app there.Gradle Scripts ->
build.gradle (Module: app) ->
minSdkVersion (Your min sdk version)