TargetSdkVersion does not look like the android manifest as selected when creating the project

I am creating a project in android using eclipse.

Now my problem is that when I create the Android application project, I install Build Sdk version to 4.1 (API 16) . But when I saw in the manifest file android:targetSdkVersion="15" . Can someone explain to me why this is happening? see screenshots below.

enter image description here

enter image description here

Thank you in advance

+4
source share
2 answers

Updated answer:

Here he goes

There is a solution

go to:

Your Directory \ Android-KFOR Windows \ Tools \ Templates \ Projects \ NewAndroidApplication \ Root

Open:

AndroidManifest.xml.ftl File

Edit:

default:

 <uses-sdk android:minSdkVersion="${minApi}" android:targetSdkVersion="${targetApi}" /> 

Modified by:

 <uses-sdk android:minSdkVersion="${minApi}" android:targetSdkVersion="${buildApi}" /> 

So the problem is here:

The attribute name ${targetApi} was specified in the ftl file, but we select the buildApi value in the project creation window.

${targetApi} or ${buildApi} default value is a higher version, which means that in your SDK tool it is API 15. So there is always 15 in the manifest.

If you tried to create a new project with a target API of less than 10 or more than 15, in the manifest it will be indicated as only 15.

Try the following:

Create a project with the target program API 8 and you will see that the manifest of the target will be only 15. (Before modifying the ftl file). But project.properties been updated correctly.

So, if you change ${targetApi} to ${buildApi} in Manifest.xml.ftl , the problem will be solved.

This is a possible mistake in the edition of 20 SDK tools. Even I updated the SDK tools, which were also not allowed in the recent edition.

Hope this can be helpful to someone who comes across this.

Old answer:

He shows me too. But in my case, I chose API 14, and it shows android:targetSdkVersion="15" in the manifest.

I suppose that some reason should be there ... 4.0 or 4.2, it assigns 4.1 in the manifest ... Or there might be an error with the Eclipse IDE. Why can't you update the new version of the Eclipse IDE and try it. This can only be a problem with the IDE.

You see that Right click-Properties is Android, Checked is the same that you selected at the beginning.

And also project.properties has the same version that you selected at the beginning.

+2
source

well, the project target that you installed is set in the default.properties file, if you change it and save, the associated sdk will change, you can try it.

the entry in the manifest is used after compilation on the device. I don’t know why it takes the wrong value. But in my eclipse it only accepts minsdkversion, and its value is the same as what I entered at the beginning. however my point is not relevant

+1
source

Source: https://habr.com/ru/post/1441459/


All Articles