Internal compiler error in eclipse -npe

2019-08-30 05:00发布

问题:

I am suddenly getting this error from eclipse when compiling.

Internal compiler error: java.lang.NullPointerException at 
 org.eclipse.jdt.internal.compiler.apt.dispatch.AnnotationDiscoveryVisitor.visit(AnnotationDiscoveryVisitor.java:61)

The project is an android project. Any clues? Don't want to do another eclipse reinstall! Help!

回答1:

Little late, but I had the same problem and also tried to find solution. Maybe it will help someone in the future:

The problem is that Eclipce is unable to compile files and it throws an exception. In my case the fix was:

  1. Move for now all compiled sources (buildBin folders)
  2. Move for now all custom builders (.externalToolBuilders) if you have ones, and all .settings folder
  3. Restart Eclipse and let it build
  4. Fix compilation problems :)
  5. Paste back all previously removed files (to not loose any settings\builders)