19

I check out the old android project on a different pc and I get a Android Pre Compiler Null pointer exception error, on every save so R.java can't be generated. The project is a library project using other library to.

The new where the project is not working is system is: 64 bit ubuntu, ADT eclipse, Android sdk tools 21.0.1, Android sdk platform-tools 16 the error is:

!ENTRY org.eclipse.core.resources 4 2 2013-01-07 02:07:15.177 !MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.core.resources". !STACK 0 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.events.AutoBuildJob.doBuild(AutoBuildJob.java:143) at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:241) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)

!ENTRY org.eclipse.core.resources 4 75 2013-01-07 02:07:15.717 !MESSAGE Errors occurred during the build. !SUBENTRY 1 com.android.ide.eclipse.adt 4 75 2013-01-07 02:07:15.717 !MESSAGE Errors running builder 'Android Pre Compiler' on project 'MyProject'. !STACK 0 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.events.AutoBuildJob.doBuild(AutoBuildJob.java:143) at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:241) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)

The project works on a old system:

The old system is: 32 bit ubuntu, 4.2.1 eclipse Juno, Android sdk tools 21,

Git is used as a version control system. It is a very strange problem I have checkt all of the xml run them with lint to find a xml build problem but no luck on every save the i have the same error and the R.java is not generated. Thanks

3
  • Arrgh.. I have the same issue, but oddly it only occurs to one of the two projects I have in the Workspace. I am on Win7 64bit, ADT v21.0.1-543035 with Eclipse Juno.
    – Crocodile
    Jan 7, 2013 at 8:36
  • also in mu case, are the projects library projects or do they use a library? Jan 7, 2013 at 11:22
  • Not library projects, just two independent standalone apps.
    – Crocodile
    Jan 7, 2013 at 12:40

5 Answers 5

27

The Android Pre Compiler in 21.0.1 appears to be badly broken, crashing on .svn directories and .DS_Store files, and files without file extensions.

The solution that worked for me was to upgrade to 21.1 rc1 following these steps:
1. Follow instructions here: http://tools.android.com/preview-channel
2. Make sure to update both SDK Manager and ADT
3. Restart Eclipse

See this bug for more information: http://code.google.com/p/android/issues/detail?id=42051

2
  • 6
    Unbelievable. Couldn't they TEST thoroughly what they release? Thanks for the info.
    – Yar
    Jan 24, 2013 at 9:59
  • @Yar, ADT is an extremely buggy program because it's just a stopgap solution for the proper Android Studio.
    – Pacerier
    Nov 12, 2014 at 9:06
13

You can add a Resource Filter in each src folder properties to avoid including automatically files not desired in your project. SVN files does crash Android pre-compiler in that version.

You should click Add and select: Exclude All / *Files and folders */ All children (recursive) / and write .svn in the edit box. Click OK to save the filter. You will need clean project probably.

6
  • 1
    I'm not sure if this fixed it or not, but after adding this resource filter and restarting (!) eclipse I no longer get this error. Jan 22, 2013 at 10:19
  • 1
    Great workaround! Thank you! As for Thomas it works for me after restarting of Eclipse.
    – Yuriy
    Jan 23, 2013 at 10:42
  • Tried to solve the problem deleting every .svn folder on the project, but it dind't work. Just to give it a try, I added the filter and.. voila! just cleaned the project and the builder stopped complaining! Thanks a lot! Jan 29, 2013 at 11:31
  • 1
    This worked for me, though I had to restart Eclipse as well, before it did so.
    – Morgan
    Jan 31, 2013 at 20:03
  • 1
    Worked for me. I'm not using svn but git and after installing the Google Play Services and "pushing" my code I start receiving the error. Feb 2, 2013 at 11:49
3

In my case the issue was caused by the .svn subfolders in the src folder. I followed the advice under comment 6 here which resolved the issue for me: http://code.google.com/p/android/issues/detail?id=42051

1
  • Now I use git too, but the original author of my source left some svn files in there. Also check if all your source files have the correct extensions, that could be another possible cause for such error from what I read on forums. Anyway, good luck!
    – Crocodile
    Jan 9, 2013 at 10:16
1

I solved the problem installing eclipse Juno and and downloaded the Android sdk 21 tools instead of sdk tools 21.0.1, it seams Ill be skipping 21.0.1. So for me now the eclise form android is a bad idea.

1

Struggled a lot with ADT 21.0.1 too, reverting helped for me: Eclipse -> About -> Installation Details -> Installation History -> Select Entry where Android version is 21.0.0 -> Press Revert.

1
  • ugh I've since installed Blackberry 10 plugins, as well as Amazon Mobile SDK plugins, this is not a solution.
    – CQM
    Jan 24, 2013 at 3:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.