这是非常常见的错误,我过去常常修复appcom的构建路径,这对我来说很有用。但是这一次,我没有看到任何这样的错误,我删除并更新了appcom的路径,但这次错误仍然存在。 R没有生成。我该怎么调试呢?我只是收到
的错误消息R cannot be resolved to a variable MainActivity.java
Unknown error: java.lang.NullPointerException IndentRaiser
在收到评论意见后,这是明确的信息:
[2015-01-19 17:02:08 - test] Using default Build Tools revision 20.0.0
[2015-01-19 17:02:08 - test] Refreshing resource folders.
[2015-01-19 17:02:08 - test] Using default Build Tools revision 20.0.0
[2015-01-19 17:02:08 - test] Starting full Pre Compiler.
[2015-01-19 17:02:08 - test] Removing generated java classes.
[2015-01-19 17:02:08 - test] Removing generated java classes.
[2015-01-19 17:02:08 - test] Generating BuildConfig.java...
[2015-01-19 17:02:08 - test] Starting full Package build.
[2015-01-19 17:02:08 - test] Using default Build Tools revision 20.0.0
[2015-01-19 17:02:08 - test] Removing generated java classes.
[2015-01-19 17:02:08 - test] Using default Build Tools revision 20.0.0
[2015-01-19 17:02:08 - test] Refreshing resource folders.
[2015-01-19 17:02:08 - test] Using default Build Tools revision 20.0.0
[2015-01-19 17:02:08 - test] Starting full Pre Compiler.
[2015-01-19 17:02:08 - test] Removing generated java classes.
[2015-01-19 17:02:08 - test] Generating BuildConfig.java...
[2015-01-19 17:02:08 - test] Starting full Package build.
[2015-01-19 17:02:08 - test] Using default Build Tools revision 20.0.0
[2015-01-19 17:02:09 - test] Using default Build Tools revision 20.0.0
[2015-01-19 17:02:09 - test] Refreshing resource folders.
[2015-01-19 17:02:09 - test] Using default Build Tools revision 20.0.0
[2015-01-19 17:02:09 - test] Starting incremental Pre Compiler: Checking resource changes.
然后是代码部分,在ADT中创建新项目后,没有添加任何新行,而是添加了新行{为新项目选择了空白活动}。 如果需要进一步的细节,请告诉我。
答案 0 :(得分:0)
在eclipse首选项中,您可以将构建输出设置为详细,如下面的屏幕截图所示。然后在控制台的底部,您可以确切地看到失败的位置。这可能会指向正确的方向。