运行 Android Lint 遇到了...失败.java.lang.NullPointerException [英] Running Android Lint has encountered a... Failed. java.lang.NullPointerException

查看:30
本文介绍了运行 Android Lint 遇到了...失败.java.lang.NullPointerException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚将 Google Play 服务库添加到我的项目中,当我对我的一个项目文件进行修改时,我不断收到来自 Eclipse 的错误对话框:

I just added Google Play Service Library to my project and when I am making a modification in one of my project files I am keep getting an error dialog from eclipse:

运行 Android Lint"遇到问题.失败.

'Running Android Lint' has encountered a problem. Failed.

所以,我启用了错误日志(窗口 -> 显示视图 -> 错误日志)选项卡,我发现了一个警告和一个错误行:

So, I enabled Error Log (Window -> Show View -> Error Log) tab and I found a warning and an error line:

错误:失败:com.android.ide.eclipse.adt

java.lang.NullPointerException
    at com.android.tools.lint.checks.ApiDetector$ApiVisitor.checkField(ApiDetector.java:1416)
    at com.android.tools.lint.checks.ApiDetector$ApiVisitor.visitSelect(ApiDetector.java:1277)
    at com.android.tools.lint.client.api.JavaVisitor$DispatchVisitor.visitSelect(JavaVisitor.java:904)
    at com.android.tools.lint.client.api.JavaVisitor$DelegatingJavaVisitor.visitSelect(JavaVisitor.java:1147)
    at lombok.ast.Select.accept(Select.java:91)
    at lombok.ast.MethodInvocation.accept(MethodInvocation.java:121)
    at lombok.ast.ExpressionStatement.accept(ExpressionStatement.java:63)
    at lombok.ast.Block.accept(Block.java:106)
    at lombok.ast.MethodDeclaration.accept(MethodDeclaration.java:240)
    at lombok.ast.NormalTypeBody.accept(NormalTypeBody.java:57)
    at lombok.ast.ClassDeclaration.accept(ClassDeclaration.java:239)
    at lombok.ast.CompilationUnit.accept(CompilationUnit.java:83)
    at com.android.tools.lint.client.api.JavaVisitor.visitFile(JavaVisitor.java:219)
    at com.android.tools.lint.client.api.LintDriver.checkIndividualJavaFiles(LintDriver.java:1624)
    at com.android.tools.lint.client.api.LintDriver.runFileDetectors(LintDriver.java:993)
    at com.android.tools.lint.client.api.LintDriver.checkProject(LintDriver.java:869)
    at com.android.tools.lint.client.api.LintDriver.analyze(LintDriver.java:442)
    at com.android.tools.lint.client.api.LintDriver.analyze(LintDriver.java:363)
    at com.android.ide.eclipse.adt.internal.lint.LintJob.run(LintJob.java:163)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)

和警告:致命错误:在 null 处找不到 API 数据库

An exception stack trace is not available.

我的应用程序正在运行,但每次编辑和保存时关闭对话框很烦人.

My application is working, but it is annoying to close the dialog each time I make an edit and save.

推荐答案

这是一种解决方法(不完全是解决方案).在 Window > Preferences > Android > Lint Error Checking 中,取消选中保存文件时检查错误".

This is a workaround (not exactly the solution). In Window > Preferences > Android > Lint Error Checking, uncheck "When saving files check for errors".

编辑:

仅当您不关心 linting 代码时才使用上述步骤.这些步骤用于关闭 Lint 检查,而不是更正报告的 lint 错误.

Please use the above steps only if you don't care about linting your code. These steps are for turning off Lint checking, not correcting the reported lint errors.

这篇关于运行 Android Lint 遇到了...失败.java.lang.NullPointerException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆