Problems encountered during Android Development -- WARNING: Application does not specify an API level requirement in Android! Solution, requirement
During the trial run of the Andorid project on the mobile phone, we found that the Console printed"WARNING: Application does not specify an API level requirement! "Such warning information is shown in:
Although the normal operation of the project is not affected, you still need to find out the cause and check the cause of the warning on the Internet. It turns out that the Min SDK Version is not specified in the AndroidManifest. xml file during project creation.
Solution: Modify the AndroidManifest. xml file and add the following code between <manifest> </manifest>:
<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="21"/>
Use android: minSdkVersion to specify the minimum SDK version for running this Android app. minSdkVersion = "8" indicates the Android 2.2 version used. android: targetSdkVersion indicates the SDK version for compiling this Android app, 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 set the android: allowBackup attribute, set android for the <application> node: allowBackup = "true" attribute; otherwise, the <application> node will receive a warning message. The modified AndroidManifest. the content of the xml file is 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 android: minSdkVersion to specify the minimum SDK version of the Android app. minSdkVersion = "8" indicates the Android 2.2 version used: targetSdkVersion indicates that the SDK version of the Android Application targetSdkVersion = "21" indicates the version of Android 5.0.1 used --> <uses-sdk android: minSdkVersion = "8" android: targetSdkVersion = "21"/> <application android: label = "@ string/app_name" android: icon = "@ drawable/ic_launcher" android: allowBackup = "true"> <activity android: name = "FrameLayoutTest" android: label = "@ string/app_name"> <intent-filter> <action android: name = "android. intent. action. MAIN "/> <category android: name =" android. intent. category. LAUNCHER "/> </intent-filter> </activity> </application> </manifest>
After the AndroidManifest. xml file is modified in this way, no warning message will appear when running the Android project.