I currently have an Android project in Eclipse.
I created it with a target build of 1.5 (sdk 3).
Now I want to change it so that it has a minSdk of 3 and tar
Another way on the command line if you are using ant is to use the android.bat script (Windows) or android script (Mac). It's in $SDK_DIR/tools.
If you say,
android.bat update project --path . --target "android-8"
it will regenerate your build.xml, AndroidManifest.xml, etc.
Well I agree with Ryan Conrad on how to do it in eclipse, have you ensured you have changed your manifest.xml?
<uses-sdk android:minSdkVersion="3" />
<uses-sdk android:targetSdkVersion="8" />
I had this problem too. What worked for me was to first un-check the previously selected SDK version before checking the new desired version. Then click okay.
As Mike way says. Change target BEFORE doing anything in your project that requires a higher target like android:installLocation="auto".
The problem sometimes occurs when there are errors in the project.
For instance, if your project is configured with a target of 3.2 but the 3.2 libraries are not available, you will not be able to change the version to 4.0!
The usual (perhaps brutal) solution I use is to create a new project with the correct target and copy src, res and manifest into the new project.
Update:
This seems to work:
I always run Android Tools | Fix Project Properties after making any changes to the build target.
as per 2018, the targetSdkVersion can be set up in your app/build.gradle
the following way:
android {
compileSdkVersion 26
buildToolsVersion '27.0.3'
defaultConfig {
...
targetSdkVersion 26
}
...
}
if you choose 26 as SDK target, be sure to follow https://developer.android.com/about/versions/oreo/android-8.0-migration