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--<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> </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