uses-sdk tag should specify a target API level AndroidManifest warning

<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="?"

This is OK for Android 2.1 and higher
project.properties

# Project target.
target=android-7

AndroidManifest.xml

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

If you insert for example

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

and
trying app on Android 2.3.3 in emulator you get this error:

ERROR: Application requires API version 14. Device API version is 10 (Android 2.3.3).
Launch canceled!

I every set min SDK == target, I have tested on the lowest API level, I claim to support this level.

android:minSdkVersion
An integer designating the minimum API Level required for the application to run. The Android system will prevent the user from installing the application if the system’s API Level is lower than the value specified in this attribute. You should always declare this attribute.
Caution: If you do not declare this attribute, the system assumes a default value of “1”, which indicates that your application is compatible with all versions of Android. If your application is not compatible with all versions (for instance, it uses APIs introduced in API Level 3) and you have not declared the proper minSdkVersion, then when installed on a system with an API Level less than 3, the application will crash during runtime when attempting to access the unavailable APIs. For this reason, be certain to declare the appropriate API Level in the minSdkVersion attribute.
Source: http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#target

This entry was posted in Bugs, warnings, errors, Eclipse and tagged , . Bookmark the permalink.


Comments are closed.

5,201 views