Eclipse / Android : "Errors running builder 'Android Pre Compiler' on project..."

Mick Byrne picture Mick Byrne · Jan 22, 2013 · Viewed 90.9k times · Source

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.

Answer

Vadim Kotov picture Vadim Kotov · Jan 31, 2013

For those of you who don't want to install preview version of ADT, there is a workaround described here.

  1. Open properties of project in Eclipse then Resources -> Resource filters.
  2. Click the "Add..." button -> Check "Exclude all", "Files and folders", "All children". In the text entry box input ".svn" (without quotes).
  3. Restart Eclipse.

I had the same problem with .git folder, it worked like a charm.