Android Lint错误地认为min SDK版本是1

Eclipse拒绝build立我的Android项目。 在包资源pipe理器中,项目的根节点有一个红色的小错误符号,但是里面没有其他符号。 “问题”选项卡显示Lint检测到的错误:

Call requires API level 3 (current min is 1): android.os.AsyncTask#<init> Call requires API level 3 (current min is 1): android.view.GestureDetector#<init> Call requires API level 3 (current min is 1): android.view.inputmethod.InputMethodManager#hideSoftInputFromWindow Call requires API level 3 (current min is 1): android.view.inputmethod.InputMethodManager#hideSoftInputFromWindow Call requires API level 3 (current min is 1): android.view.inputmethod.InputMethodManager#showSoftInput Call requires API level 3 (current min is 1): android.view.inputmethod.InputMethodManager#showSoftInput Call requires API level 3 (current min is 1): android.view.inputmethod.InputMethodManager#showSoftInput Call requires API level 3 (current min is 1): android.view.inputmethod.InputMethodManager#toggleSoftInput Call requires API level 3 (current min is 1): android.view.Menu#getItem Call requires API level 3 (current min is 1): android.view.Menu#getItem Call requires API level 3 (current min is 1): android.widget.HorizontalScrollView#getId Call requires API level 5 (current min is 1): android.app.Activity#onBackPressed Call requires API level 5 (current min is 1): android.app.Activity#onBackPressed Call requires API level 5 (current min is 1): android.app.Activity#onBackPressed Class requires API level 3 (current min is 1): android.view.inputmethod.InputMethodManager Class requires API level 3 (current min is 1): android.view.inputmethod.InputMethodManager Class requires API level 3 (current min is 1): android.view.inputmethod.InputMethodManager Class requires API level 3 (current min is 1): android.view.inputmethod.InputMethodManager Class requires API level 3 (current min is 1): android.view.inputmethod.InputMethodManager Class requires API level 3 (current min is 1): android.view.inputmethod.InputMethodManager Class requires API level 3 (current min is 1): android.widget.HorizontalScrollView Class requires API level 3 (current min is 1): android.widget.HorizontalScrollView Field requires API level 3 (current min is 1): android.os.Build#DISPLAY Field requires API level 4 (current min is 1): android.content.res.Configuration#screenLayout Field requires API level 4 (current min is 1): android.os.Build#CPU_ABI Field requires API level 4 (current min is 1): android.os.Build#MANUFACTURER Field requires API level 4 (current min is 1): android.os.Build$VERSION#SDK_INT 

我最好的猜测是,林特认为我的minSdkVersion是1,这不是; 我的清单声明minSdkVersion="8" 。 我已经尝试了以下努力解决这个问题:

  • 重新启动Eclipse
  • 重新启动我的电脑
  • 项目>清洁
  • 手动删除/bin/gen以强制下摆重新生成

在这一点上,我没有想法。 有人有build议?

Solutions Collecting From Web of "Android Lint错误地认为min SDK版本是1"

我有同样的问题,我的解决scheme是:

右键单击项目文件夹> Android工具>清除林克标记

“运行Android Lint”会生成一些标记,标记会导致此错误。

“接受答复”中的“清除绒毛标记”临时删除了该错误,但每次我在受影响的项目中保存一个文件时都会再次出现。

要停止报告错误,我必须完全禁用lint检查:

 Right click project -> Properties -> Android Lint Preferences Search for "minSdk" in the search box Click on "UsesMinSdkAttributes" Click the "Ignore All" button at the bottom. 

清理并重build项目,Eclipse / ADT将不再运行minSdk的lint检查项目。

确保你有android: namespace标识符和minSdkVersion属性。 喜欢这个:

android:minSdkVersion="8"

当创build一个基于一些Android示例项目(如BluetoothChat)的项目时,命名空间被省略并混淆Lint。 那么即使清理Lint标记也不能真正解决问题,因为它们在再次运行Lint之后重新出现,这经常会自动发生。

注意:这已通过API16样本修订版1validation

尝试右键单击项目文件夹> Android工具>修复属性

你也应该检查在所有的Android库和东西的构build属性检查和正确的顺序加载。 右键单击项目>属性>生成

一个简单的项目 – >清洁也解决了我的问题。