尝试生成签名的 APK,但我收到此消息:
Error:Error: Suspicious method call; should probably call "layout" rather than "onLayout" [WrongCall]
我在方法上添加了 SupressLint,但它不起作用:
@SuppressLint("WrongCall")
@Override
protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
}
干杯!
最佳答案
With Android Studio, you can also run lint inspections for a specific build variant, or for all build variants from the build.gradle file. Add the lintOptions property to the android settings in the build file. This code snippet from a Gradle build file shows how to set the quiet option to true and the abortOnError option to false.
android {
lintOptions {
// set to true to turn off analysis progress reporting by lint
quiet true
// if true, stop the gradle build if errors are found
abortOnError false
// if true, only report errors
ignoreWarnings true
}
...
}
关于java - APK 构建可疑方法调用时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34309521/