简体   繁体   English

Android studio:调用需要API Level 16错误

[英]Android studio : call requires API Level 16 error

I'm getting the following error in Android studio. 我在Android studio中遇到以下错误。 The sqlitedatabase.close() method is available since API Level 1 but the android studio ide fails to detect that. sqlitedatabase.close()方法从API Level 1开始可用,但android studio ide无法检测到它。

Android Studio错误

As Ahmad said, it looks like a bug. 正如艾哈迈德所说,这看起来像个臭虫。 Meanwhile, try releaseReference() which is equivalent to see if the same happens. 同时,尝试releaseReference() ,这相当于查看是否发生相同的情况。

UPDATE: 更新:

Supposing you were in Eclipse, to re-enable checks (found here ): 假设您在Eclipse中,重新启用检查(在此处找到):

Lint puts the file "lint.xml" to the project with the dependant items. Lint将文件“lint.xml”放入具有依赖项的项目中。

<lint>
  <issue id="UnusedResources">
    <ignore path="res\layout\my_layout.xml" />
  </issue>
<lint>

Unfortunatelly, editing and saving this file is not enough. 不幸的是,编辑和保存此文件是不够的。 You have to close and re-open the project or even Eclipse. 您必须关闭并重新打开项目甚至Eclipse。

Not sure if Android Studio does the same. 不确定Android Studio是否也这样做。

UPDATE 2: 更新2:

In Android Studio, you can see all the Lint based inspections and tune them in 'Settings | 在Android Studio中,您可以查看所有基于Lint的检查,并在“设置”中进行调整 Inspections | 检查| Android | Android | Lint'. 皮棉'。

Or you could use the command line tool in the SDK tools/ directory called lint. 或者您可以使用名为lint的SDK工具/目录中的命令行工具。

Check this : 检查一下

There seems to be an issue, when the project directory is not directly under the workspace directory. 当项目目录不直接位于工作空间目录下时,似乎存在问题。

As of today the bug should be fixed in release 20: http://code.google.com/p/android/issues/detail?id=27527 截至今天,该漏洞应该在第20版中修复: http//code.google.com/p/android/issues/detail?id = 27527

In that case, the problem was solved by switching workspace to a fresh one. 在这种情况下,通过将工作空间切换到新的工作空间来解决问题。 It probably was a problem with settings left over from previous lint versions 从以前的lint版本遗留的设置可能存在问题

几天前,出现了更新版本(构建AI-130.687321,日期为2013年5月24日),问题已解决。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在Android Studio中为消息“调用要求API级别21(当前最小值为16)”启用lint错误? - How to enable lint error in Android Studio for message “Call requires API level 21 (current min is 16)”? Android Studio:List.of() &#39;调用需要 API 级别...&#39; - Android Studio: List.of() 'Call requires API level...' 调用需要API级别16(当前最小值为10):android.widget.ImageView#getMaxWidth - Call requires API level 16 (current min is 10): android.widget.ImageView#getMaxWidth 调用需要API级别16(当前最小值为14):android.app.Notification.Builder #build - Call requires API level 16 (current min is 14): android.app.Notification.Builder#build 调用要求API级别16(当前最小值为14),并带有EndAction - Call requires API level 16 (current min is 14) withEndAction 呼叫需要API级别16(当前最小值为14) - Call requires API level 16 (current min is 14) Android Studio:使用API​​级别16进行编译 - Android Studio : Compiling with API level 16 BigDecimal调用需要API级别Android 24 - BigDecimal call requires API level 24 Android 如何删除“调用需要 API 级别”错误? - How to remove “Call requires API level” error? TextureView setSurfaceTexture方法需要API 16级别 - TextureView setSurfaceTexture method requires API 16 level
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM