Home > Java > javaTutorial > body text

Examples of problems encountered in Android development

零下一度
Release: 2017-06-23 09:28:36
Original
1351 people have browsed it

When I was debugging and running the Andorid project on my mobile phone today, I found that the Console printed out a warning message like "WARNING: Application does not specify an API level requirement!", as shown in the figure below:

 

Although it does not affect the normal operation of the project, we still need to find out the reason. I checked the reason for the warning online. It turns out that the Min SDK Version was not specified in the AndroidManifest.xml file when creating the project.

Solution: Modify the AndroidManifest.xml file and add the following code between :

<uses-sdk></uses-sdk>
Copy after login

Use android:minSdkVersion to specify the run The minimum SDK version of this Android application, minSdkVersion="8" indicates the version of Android 2.2 used, android:targetSdkVersion indicates the SDK version used to compile this Android application, targetSdkVersion="21" indicates the version of Android 5.0.1 used.

After adding the configuration item of the <uses-sdk></uses-sdk> node, if the node does not set the android:allowBackup attribute, then set android for the node :allowBackup="true" attribute, otherwise a warning message will appear on the node. The content of the modified AndroidManifest.xml file is as follows:

Examples of problems encountered in Android development


      
  
  <uses-sdk></uses-sdk>
    
    
        
            
                
                
            
        
    
    
Copy after login
Examples of problems encountered in Android development
## After the AndroidManifest.xml file is modified in this way, the warning message will not appear when running the Android project.

The above is the detailed content of Examples of problems encountered in Android development. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template