Problems encountered in Android development--android Warning:application does not specify a API level requirement! workaround

Source: Internet
Author: User

When commissioning the Andorid project on a mobile phone today, I found that the console printed "warning:application does not specify a API level requirement!" The warning message is as follows:

  

Although it does not affect the normal operation of the project, but to find out why, the Internet to check the cause of the warning, originally created the project when the Androidmanifest.xml file does not specify the min SDK Version

Workaround: Modify the Androidmanifest.xml file and add the following code between <manifest> </manifest>:

<USES-SDK        android:minsdkversion= "8"        android:targetsdkversion= "/>"

Using Android:minsdkversion to indicate the minimum SDK version to run this Android app, minsdkversion= "8" indicates the version of Android 2.2 used, Android: Targetsdkversion indicates that the SDK version of this Android app is compiled, and targetsdkversion= "21" indicates the version of Android 5.0.1 used.

After adding the configuration items for the <uses-sdk/> node, if the,<application></application> node does not have the Android:allowbackup property set, then it is < The application> node sets the android:allowbackup= "true" property, otherwise the <application> node will receive a warning message, The contents of the modified Androidmanifest.xml file are as follows:

<?xml version= "1.0" encoding= "Utf-8"? ><manifest xmlns:android= "http://schemas.android.com/apk/res/ Android "package=" Me.gacl.ui "android:versioncode=" 1 "android:versionname=" 1.0 "> <!--use Androi D:minsdkversion indicates that the minimum version of the SDK running this Android app minsdkversion= "8" means Android 2.2 is being used: Targetsdkversion indicates that compiling the SDK version of this Android app targetsdkversion= "21" means the version of Android 5.0.1 used--&LT;USES-SDK Android:mi         nsdkversion= "8" android:targetsdkversion= "/> <application android:label=" @string/app_name " android:icon= "@drawable/ic_launcher" android:allowbackup= "true" > <activity android:name= "Frame Layouttest "android:label=" @string/app_name "> <intent-filter> <acti On android:name= "Android.intent.action.MAIN"/> <category android:name= "Android.intent.category.LAUNC Her "/> </intent-filter> </activity> &LT;/application> </manifest> 

After the Androidmanifest.xml file has been modified, there is no warning message when you run the Android project.

Problems encountered in Android development--android Warning:application does not specify a API level requirement! workaround

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.