[英]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无法检测到它。
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工具/目录中的命令行工具。
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.