Warning about <uses-sdk> in Manifest?

27,361

Solution 1

Just add the android:targetSdkVersion="8" attribute to the uses-sdk tag. If you just want to get rid of the warning, that will do it, safely.

If you want to know more, here's a description of what that attribute means,

http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#target

The docs are a little fuzzy, but what they say is that the target SDK version is used to determine if android should enable compatibility layers. for example, If your min SDK was 8, but your target SDK was 14, you are telling android that while there's no reason it shouldn't work on version 8, you've only tested on 14. Therefore, if there any compatibility settings to enable between level 8 and 14, they can be set. note that this attribute may actually do nothing depending on the actual min / target values.

If you set min SDK == target, you are essentially saying you have tested on the lowest API level you claim to support, which is a good thing.

Solution 2

I have one walkaround solution.

  • Copy the manifest file, paste in your desktop.
  • Delete the manifest file in your project
  • Copy the manifest file from your desktop
  • And Paste in your project.

Worked for me as the warning disappeared.

Share:
27,361
Cole
Author by

Cole

Updated on June 15, 2020

Comments

  • Cole
    Cole about 4 years

    I'm getting a warning on my in the Manifest.

    <uses-sdk> tag should specify a target API level (the highest verified version; 
    when running on later versions, 
    compatibility behaviors may be enabled) with android:targetSdkVersion="?"
    

    What does this mean?

    I've got

    <uses-sdk
        android:minSdkVersion="7" />
    

    In it at the moment. (Android 2.1)