林特误差在Android上大号片段:"此方法不覆盖任何东西" [英] Lint error with Fragments on Android L: "This method is not overriding anything"
问题描述
此方法不覆盖任何与当前构建的目标, 但会在API级别11(目前的目标是1)。
This method is not overriding anything with the current build target, but will in API level 11 (current target is 1).
我如何消除这种错误?该应用程序编译和运行。我使用的摇篮:
How do I neutralize this error? The app compiles and runs. I'm using gradle:
android {
compileSdkVersion "android-L"
buildToolsVersion "19.1.0"
defaultConfig {
applicationId "com.codepath.apps.restclienttemplate"
minSdkVersion 14
targetSdkVersion "android-L"
}
....
}
据该 <使用-SDK>
的文档,如果的minSdkVersion
缺席默认为1,所以我想皮棉不知道是什么版本是必需的。
According to to the <uses-sdk>
docs, if minSdkVersion
is absent it defaults to 1, so I'm thinking lint doesn't know what version is required.
推荐答案
我怀疑的API级别的字符串,如的android-L
或→
解析为 1
的API级别,并认为加万吨的方法是不存在的,直到后来的API级别(甚至是非常低的API级别的方法在4或7)。
I suspect that strings for API levels such as android-L
or L
resolves to 1
for the API level and it sees tons of methods that don't exist until later API levels (even very low API level methods added in 4 or 7).
由于SDK是preVIEW,而不是最终的,我说这对我lint.xml文件:
Since the SDK is a preview and not final, I added this to my lint.xml file:
<!-- Android L pre-release disabled checks -->
<issue id="Override" severity="ignore"/>
请务必将其卸下的Android L的SDK正式发布,您可以使用 21
,而不是一个字符串。
Be sure to remove it once Android L's SDK is officially released and you can use 21
instead of a string.
这篇关于林特误差在Android上大号片段:&QUOT;此方法不覆盖任何东西&QUOT;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!