19

My Eclipse out of the blue stopped building my Android so I removed the old version and have installed Indigo. When I try to import an Android project in I get this error:

Errors occurred during the build.
Errors running builder 'Android Resource Manager' on project 'ACCUWX_HoneyComb'.
java.lang.NullPointerException
Errors running builder 'Android Pre Compiler' on project 'ACCUWX_HoneyComb'.
java.lang.NullPointerException
Errors running builder 'Java Builder' on project 'ACCUWX_HoneyComb'.
java.lang.NullPointerException

Please help!

Jeff Axelrod
  • 27,676
  • 31
  • 147
  • 246
taraloca
  • 9,077
  • 9
  • 44
  • 77
  • 1
    have you installed the Android SDK and stuff in your new Eclipse? – zapl Mar 08 '12 at 12:46
  • Installed some, now installing other versions to see if that corrects. – taraloca Mar 08 '12 at 12:53
  • 1
    Make sure eclipse is building using java 1.6. It will default to 1.7 if you have it installed – dymmeh Mar 08 '12 at 12:55
  • I have no idea what is going on...I have installed all Android SDK's from 4.0.3 down to 1.6 including extras. I try to start eclipse and I get this: "An internal error occurred during "Initializing Java Tooling" AND Android SDK Content Loader "parseSdkContent failed...java.lang.NullPointerException – taraloca Mar 08 '12 at 13:03
  • Eclipse is building using java 1.6. Still same error – taraloca Mar 08 '12 at 13:08
  • I had unmerged files in project so I reverted back to HEAD with git, imported project and it worked. I am now going to attempt the merge because that is where all went wrong yesterday and caused me to upgrade my eclipse. – taraloca Mar 08 '12 at 13:26
  • Eclipse didn't include my "src" folder in the project and I use this project as a shared project. Therefore when I was trying to run my other project, it didn't have any necessary files with the jar. – taraloca Mar 08 '12 at 20:08

11 Answers11

18

Try removing the .metadata folder from your workspace. This holds all your configurations, even after a new install. I think if you just delete this folder, assuming everything is in place, you should be up and running again.

jjNford
  • 5,170
  • 7
  • 40
  • 64
  • 1
    +1 the ULTIMATE SOLUTION, lol, I tried everything except this, and wow this works...HAIL @jjNford. – Some one Some where Jun 22 '12 at 08:58
  • 3
    well, this effectively removed my workspace :) so be **warned**, fellow naive developers! and do **rename** instead of *delete* – n611x007 May 09 '13 at 08:58
  • @naxa i think this is straight forward given you are removing a hidden folder full of configurations from your workspace - as mentioned above. – jjNford May 09 '13 at 19:30
  • I like the answer, still it's maybe best to keep things with (kind of) data loss included being told explicitly. Telling it directly is better than leaving it hang in the indirect. Especially when the spirit of NullPointerException, and reminiscence of null pointer dereference, shadows us all from the skies! ;) – n611x007 May 10 '13 at 04:57
6

The 21.0.1 version of the Eclipse 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 which has extenion-less files.

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.

Mick Byrne
  • 14,394
  • 16
  • 76
  • 91
5

This happened to me today with ADT v21.0.1-543035 and it turned out to be the .svn directories throughout the directory structure. See http://code.google.com/p/android/issues/detail?id=42051

Worked around the issue by upgrading svn client and working copy to 1.7.

jrr
  • 1,877
  • 19
  • 29
  • +1 big thanks, after going from 1.6.x to 1.7.x i had to 'upgrade working copy' and then delete and re-add the project. – ggenglish Jan 14 '13 at 03:55
4

For me, the source of the NullPointerException problem was a host-side Junit test project that references (and tests) code from an Android project. It didn't have a project.properties file. It's not an Android project, but for some reason the newer version of the SDK somehow expects the file there. To fix the problem, I just copied a project.properties file from an Android project to the host unit test project.

Jeff Axelrod
  • 27,676
  • 31
  • 147
  • 246
3

I had something similar. The problem was created by having some files without extension inside the /src folder.

petrumo
  • 1,116
  • 9
  • 18
1

In my case, a branch tool, changed the encode of the file project.properties, I changed the encode to Windows-1265 and the problem was solved.

Helton Isac
  • 764
  • 7
  • 12
1

I had the same issue and fixed it by following comment number 6 in this page: Issue 42051: Subversion folder causes NPE in PreCompilerBuilder

Let me quote the comment:

Solved it by installing subversion support packages for eclipse:

http://gan.so/VgYT

It's still a bug but...

andr
  • 15,970
  • 10
  • 45
  • 59
Hisham Bakr
  • 559
  • 4
  • 13
1

same problem here, I closed Eclipse, manually removed any files in folder gen for the project, started Eclipse again, and made a build.

mochasoft
  • 159
  • 2
1

For also me, the source of the NullPointerException problem was a host-side Junit test project that references (and tests) code from an Android project. It didn't have a project.properties file. I added it and problem got fixed.

1

I found the solution on this website(https://code.google.com/p/android/issues/detail?id=68755)

So basically, what we should do is : Bring up $ADT_DIR/eclipse/Eclipse.app/Contents/MacOS/eclipse.ini in an editor. Before the -vmargs line, insert these two lines:

-vm 
/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Commands/java

you can find the eclipse.ini following this (On a Mac OS X system, you can find eclipse.ini by right-clicking (or Ctrl+click) on the Eclipse executable in Finder, choose Show Package Contents, and then locate eclipse.ini in the MacOS folder under Contents)

-1

Upgrades did not work for me (on Linux), so I just installed IntelliJ Idea (build 123.155). Had to modify idea.sh to set JDK_HOME=/usr/lib/jvm/jdk1.7.0 (the Oracle JDK) and to select [menu] -- Run -- Run... -- Edit Configurations... -- Target Device -- USB device to make it work with the real device.

18446744073709551615
  • 16,368
  • 4
  • 94
  • 127