Eclipse/Android:“在项目上运行构建器'Android预编译器'时出错......" [英] Eclipse / Android : "Errors running builder 'Android Pre Compiler' on project..."

查看:52
本文介绍了Eclipse/Android:“在项目上运行构建器'Android预编译器'时出错......"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

试图在我几个月没有工作的 Android 项目上做一些工作,但每次我尝试构建项目时 Eclipse 都会弹出一个对话框说:

'Building workspace'遇到问题构建过程中发生错误.在项目XXX"上运行构建器Android 预编译器"时出错java.lang.NullPointerException

我在 Mac 上运行 Eclipse,Android 项目构建目标为 4.0.3(API 级别 15),并且我安装了以下版本的东西

  • Eclipse - 3.7.2
  • Android 开发工具 - 21.0.1
  • Android SDK - 最多 17 个

我已经尝试了一些事情,比如开始一个全新的工作区,安装这个颠覆性的 SVN JDT 忽略扩展",升级所有东西,确保我的源文件夹(或任何地方)中没有任何没有扩展名的文件否则),确保我的 Java 编译器是 1.6,然后将其关闭再打开.

编辑

这里是 Eclipse 错误日志中针对此问题的堆栈跟踪:

java.lang.NullPointerException在 com.android.ide.eclipse.adt.internal.build.builders.PreCompilerBuilder.build(PreCompilerBuilder.java:673)在 org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:728)在 org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)在 org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:199)在 org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:239)在 org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:292)在 org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)在 org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:295)在 org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:351)在 org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:374)在 org.eclipse.core.internal.resources.Workspace.buildInternal(Workspace.java:513)在 org.eclipse.core.internal.resources.Workspace.build(Workspace.java:432)在 org.eclipse.ui.actions.BuildAction$1.runInWorkspace(BuildAction.java:305)在 org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38)在 org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

和会话数据:

<前>eclipse.buildId=M20120208-0800java.version=1.6.0_37java.vendor=苹果公司BootLoader 常量:OS=macosx,ARCH=x86_64,WS=cocoa,NL=en_US框架参数:-keyring/Users/onemick/.eclipse_keyring -showlocation命令行参数:-os macosx -ws cocoa -arch x86_64 -data/Projects/_EclipseWorkspace -keyring/Users/onemick/.eclipse_keyring -showlocation

另一个编辑

好的,更多的搜索让我找到了这个页面,这表明此问题肯定与我的项目中存在没有扩展名的文件有关 - 但是我不知道是哪个文件,并且在我的一生中我在该项目中找不到任何文件!

如果有人能解释此错误的含义以及我如何获得有关潜在错误的更多调试信息,我什至会很高兴.

解决方案

我总是讨厌回答我自己的问题,但这是一个真正的解决方案.

ADT 工具的 21.0.1 版本有一个错误,如果您有任何没有扩展名的文件,它会阻止项目构建.对于使用具有无扩展名文件的 subversion 的用户(如我)来说,这是一个特殊问题.

推荐的一种解决方案是安装这些颠覆性"Eclipse 插件(帮助 > 安装新软件 > 使用您的 Eclipse 版本站点 > 展开协作"> 选择颠覆性 SVN JDT 忽略扩展"和颠覆性 SVN 团队提供者")但这对我不起作用(我在 Indigo,也许在 Juno 上它有效).

解决方案是安装 Google 提供的 ADT 工具和 SDK 管理器的 21.1 预览版.清楚的说明可以在这里找到,您可以阅读所有背景将您的声音添加到这里是一群愤怒的开发者.

Attempting to do some work on an Android project I haven't worked on for a couple of months, yet every time I attempt to build the project Eclipse throws up a dialog saying:

'Building workspace' has encountered a problem

Errors occurred during the build.
Errors running builder 'Android Pre Compiler' on project 'XXX'
java.lang.NullPointerException

I'm running Eclipse on a Mac with an Android project build target 4.0.3 (API Level 15) and I've the following versions of things installed

  • Eclipse - 3.7.2
  • Android Development Tools - 21.0.1
  • Android SDK - up to 17

I've already tried a few things, like starting a whole new workspace, installing this 'Subversive SVN JDT Ignore Extensions', upgrading everything, making sure I don't have any files without extensions in my source folder (or anywhere else), ensuring my Java compiler is 1.6 and switching it off and on again.

EDIT

Here's the stack trace from the Eclipse error log for this problem:

java.lang.NullPointerException
at com.android.ide.eclipse.adt.internal.build.builders.PreCompilerBuilder.build(PreCompilerBuilder.java:673)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:728)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:199)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:239)
at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:292)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:295)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:351)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:374)
at org.eclipse.core.internal.resources.Workspace.buildInternal(Workspace.java:513)
at org.eclipse.core.internal.resources.Workspace.build(Workspace.java:432)
at org.eclipse.ui.actions.BuildAction$1.runInWorkspace(BuildAction.java:305)
at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

And the session data:

eclipse.buildId=M20120208-0800
java.version=1.6.0_37
java.vendor=Apple Inc.
BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=en_US
Framework arguments:  -keyring /Users/onemick/.eclipse_keyring -showlocation
Command-line arguments:  -os macosx -ws cocoa -arch x86_64 -data /Projects/_EclipseWorkspace -keyring /Users/onemick/.eclipse_keyring -showlocation

ANOTHER EDIT

OK, so more searching led me to this page, which suggests that this issue is definitely related to the presence of files without an extension in my project - however I don't know which file and for the life of me I can't find any in that project!

I'd even be happy if someone could explain what this error means and how I might get more debug info about the underlying error.

解决方案

I always hate answering my own questions, but this is a genuine solution.

The 21.0.1 version of the ADT tools has a bug that prevents a project building if you have any files without extensions in them. This is a particular problem for users (like me) using subversion with has extension-less files.

One recommended solution is to install these 'subversive' Eclipse plugins (Help > Install new Software > Work with your Eclipse version site > Expand 'Collaboration' > Choose 'Subversive SVN JDT Ignore Extensions' and 'Subversive SVN Team Provider') but this didn't work for me (I'm on Indigo, perhaps on Juno it works).

The solution is to install the 21.1 preview version of the ADT tools and SDK manager from Google. Clear instructions can be found here and you can read all the background add your voice to the angry mob of developers here.

这篇关于Eclipse/Android:“在项目上运行构建器'Android预编译器'时出错......"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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