应用程序没有指定API级别 [英] Application does not specify API level

查看:367
本文介绍了应用程序没有指定API级别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚开始使用Eclipse的Andr​​oid应用程序。 我已经安装了Eclipse 3.5.2和Java 5 AVD的是Android 2.1的API 7

I am just beginning to use Eclipse for Android applications. I have installed Eclipse 3.5.2 and Java 5 AVD is Android 2.1 API 7

我最初的Hello Android程序运行得很好,但不会再次运行。

My initial Hello Android program ran fine but will not run again.

收到以下错误:

[2010-07-25 9时47分31秒 - HelloAndroid]警告:应用程序没有指定的API等级要求
  [2010-07-25九时47分31秒 - HelloAndroid]设备API的版本是7(安卓2.1 UPDATE1)

[2010-07-25 09:47:31 - HelloAndroid] WARNING: Application does not specify an API level requirement!
[2010-07-25 09:47:31 - HelloAndroid] Device API version is 7 (Android 2.1-update1)

搜查了论坛,但只能找到一个refernece到清单文件,以确保以下设置:

searched the forums but could only find a refernece to manifest file to be sure following was set:

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

我的manifest文件不包含该行:

my manifest file does not contain that line:

 <?xml version="1.0" encoding="utf-8" ?> 
 <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.helloandriod" android:versionCode="1" android:versionName="1.0">
     <application android:icon="@drawable/icon" android:label="@string/app_name">
         <activity android:name=".HelloAndroid" 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>

我检查了高级经理,并将其设置为7 在Eclipse我去属性 - > Android和将其设置为7。

I have checked the adv mgr and it is set to 7 In Eclipse i went to properties -> Android and set it to 7

得到同样的警告

推荐答案

那么,如果Eclipse是,无论出于何种原因,没有产生该行对你来说,用一切手段,你可以自己添加。

Well, if Eclipse is, for whatever reason, not generating that line for you, by all means you can add it yourself.

添加一行:
&LT;使用-SDK安卓的minSdkVersion =3/&GT;

Add the line:
<uses-sdk android:minSdkVersion="3" />

您的清单,该清单结束标记前。

to your manifest, right before the ending manifest tag.

这篇关于应用程序没有指定API级别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆