Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Warning about <uses-sdk> in Manifest?

Tags:

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)

like image 709
Cole Avatar asked Mar 31 '12 21:03

Cole


People also ask

What is the necessity of user sdk tag in Android manifest XML file?

It lets the Android platform describe the maximum framework API revision that it supports. It lets applications describe the framework API revision that they require. It lets the system negotiate the installation of applications on the user's device, such that version-incompatible applications are not installed.

What does target sdk stand for?

targetSdkVersion is a property that tells the system for which Android version the app was designed and tested on.

What is sdk version in Android?

The Android SDK consists of an emulator, development tools, sample projects with source code, and the required libraries to build Android applications. Let's look at the key components one by one.

What is sdk compatibility?

The Android SDK is by default forward compatible but not backward compatible — this means that an app that is built with and supports a minimum SDK version of 3.0 can be installed on any device running Android versions 3.0 and upwards — but not on devices running Android versions below 3.0.


2 Answers

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.

like image 155
Jeffrey Blattman Avatar answered Nov 30 '22 07:11

Jeffrey Blattman


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.

like image 32
Musculaa Avatar answered Nov 30 '22 07:11

Musculaa