13

Every time I open Eclipse, I get the following error messages:

Android SDK Content Loader: parseSdkContent failed java.lang.NullPointerException

Initializing Java Tooling An internal error occured during: "Initializing Java Tooling". java.lang.NullPointerException

Loading data for Android 2.2 Parsing Data for android-8 failed java.lang.NullPointerException

Loading data for Android 2.3.3 Parsing Data for android-10 failed java.lang.NullPointerException

Loading data for Google APIs (Google Inc.) Parsing Data for Google Inc.: Google APIs:8 failed java.lang.NullPointerException

See link for screenshot: https://i.stack.imgur.com/lhhQQ.png

(I am using OS X Lion, and Eclipse Helios)

First i read some posts saying that it was the AVD.ini file in the .android profile that was causing the trouble. I tried deleting all the entire .android profile folder as suggested in Android SDK Content Loader failing with NullPointerException. This didn't correct my problem.

I tried deleting the entire Android SDK folder, downloaded it again and installed a couple of Android versions through it. Still the same error messages...

To ensure that I didn't have any old plugins or something that were the issue, I uninstalled eclipse, downloaded it again and installed the Android plugin again. (So the plugin is up to date).

When I go into one of my Android projects, I get error messages on places where I acces resources by using the R file. Regular Java projects work fine, but all Android projects gets small red boxes with white crosses on them. I have been searching for a solution to this problem since yesterday, but at this point I'm completely qlueless and would appreciate any help I can get!

Community
  • 1
  • 1
Njaal Gjerde
  • 653
  • 1
  • 6
  • 14
  • 1
    I have the same problem on windows. I think it is related to the latest SDK tools version (19). I don't think there is a easy way (or even a hard way) to revert the SDK tools version. I could be wrong though. – Greg McGowan Apr 17 '12 at 14:57
  • Hi. I tired this and it worked - http://stackoverflow.com/a/9619011/418277 – Greg McGowan Apr 18 '12 at 08:32
  • I am also facing the same issue now. 2 days over now, still no result – tejas May 04 '12 at 10:05
  • Does anyone have a solution for this on a Mac running Lion? – chucky May 28 '12 at 01:30
  • This worked for me on a MacBook Air running Lion: http://blog.timmattison.com/archives/2009/11/10/how-to-fix-a-broken-eclipse-environment-without-starting-completely-from-scratch/ – chucky May 28 '12 at 06:29
  • Did you solve this problem? I am facing it currently. – briankip Aug 06 '14 at 17:34

16 Answers16

9

Close all open projects and exit Eclipse. Now you can open Eclipse without getting the error. Start opening your projects one by one to find which one causes the problem. This is most likely because you deleted a Device profile inside the AVD manager.

slott
  • 3,266
  • 1
  • 35
  • 30
  • 1
    i had a circular library dependency and i kept getting this error with no resolution. Your insight to close all projects helped. After that i just removed the last library i had added to the project. – j2emanue Nov 22 '13 at 22:33
2

Do not delete all the full .metadata

  • Backup .metadata
  • delete only .metadata/.plugins/org.eclipse.core.resources/.project
  • restart eclipse

Observation : the projects folders are created

Further - if you are using svn/git/hg have code repository links it would be destroyed, so to reinstate

  • close eclipse
  • copy relevant projects from backup to merge with current projects in .metadata/.plugins/org.eclipse.core.resources/.project
  • restart eclipse

Downfall - sporadic fail error may occur (sync or something) - harmless

backagain

raj
  • 642
  • 9
  • 18
  • This did nothing for me--even before the copying of the backups. Error persists upon restart. – Jeff Axelrod May 04 '12 at 03:09
  • This didn't quite work for me. It worked a bit, but it caused errors elsewhere in my workspace. I ended up deleting my project and checking it out again, which worked. – Christine Jun 01 '12 at 00:00
  • err, which worked, to a certain extent. I had to copy .project and .properties files from my old project in order to make it work. – Christine Jun 01 '12 at 03:04
2

I encountered exactly the same issue this morning. This is a workspace related issue.

Solution 1
I looked into my .metadata and read .bak_number.log files . Some layouts failed to parse and my projects were out of sync with the file system. So I deleted all the .bak_number.log files. Relaunch Eclipse and the whole worskspace should work again the way you left previously.

Solution 2
However if it's not due to out of sync with the file system. Change the workspace then import all the eclipse projects from the previous workspace. Thanks the project.properties files , the dependencies are still kept.

PS : I should return to IntelliJ :)

Raymond Chenon
  • 11,482
  • 15
  • 77
  • 110
1
  1. first close your Eclipse

  2. Go to your workspace and rename .metadata to tushmetadata and go to tushmetadata- >.plugins -> org.eclipse.core.runtime -> .settings and copy all files from it.

  3. now open the Eclipse and go to your workspace there you can see the newly generated .metadata folder in that go to .plugins -> org.eclipse.core.runtime -> .settings and paste here and do not overwrite any file.

  4. Try to "Hello World" project and run it.

0

Try to delete file .metadata from your android workspace folder. .Metadata folder contains all configuration files for eclipse. It works for me.

ashutosh
  • 759
  • 5
  • 13
  • 34
0

Your answers might be right. What I did was to change my workspace. I redownloaded the project I was going to work on from git, and reimported it. Now it works fine :) Maybe there was some files in this project that made the error messages apear? Dunno....

Njaal Gjerde
  • 653
  • 1
  • 6
  • 14
0

I have remove the .metadata folder but after it, when I run the eclipse, I cannot creates any Android project. To solve it, I have done the follow:

  1. Go to the main work directory of eclipse
  2. Localize the folder com.android.ide.eclipse.adt It should be in .oldMetadata/.plugins/
  3. Copy it to the new eclipse configuration: .metadata/plugins/

See the full solution here: http://www.jiahaoliuliu.com/2011/06/running-android-sdk-in-eclipse-errors.html#solution4

jiahao
  • 3,373
  • 2
  • 35
  • 36
0

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 versions 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
0

When I met this problem about a year ago, I had some projects in my workspace that needed a specific Android SDK level (let's say 2.1) and i didn't have it installed in the Android SDK.

overbet13
  • 1,654
  • 1
  • 20
  • 36
  • 1
    Just had the same problem after cleaning up my AVD files. I found it best to close all my projects and open the one I use and take it from there. – slott Jun 20 '12 at 11:05
0

slott's answer helped a lot. Deleting the .metadata or reinstalling eclipse didn't though. The trick was to isolate the project causing the problem, delete its .settings folder and .project file and reimport it.

Zoltán
  • 21,321
  • 14
  • 93
  • 134
0

I discovered another cause, where I'd added a space character into an otherwise blank line in the project.properties file. When I eventually ran android update project -p . the program (android.exe) threw a NPE exception. When I deleted the space from the blank line the android update project command worked and eclipse started behaving (after running clean a few times).

This happened with r20 of the Android SDK on a Windows 7 64-bit machine.

FYI my change that fixed the problem in project.properties is public at http://code.google.com/p/android-daisy-epub-reader/source/detail?r=517

JulianHarty
  • 3,178
  • 3
  • 32
  • 46
0

I found it's just missing project.properties file in the project folder. After copying one from another project the error is gone. The only valid line in project.properties is

target=android-8
Nikhil
  • 16,194
  • 20
  • 64
  • 81
Fan
  • 1
0

This is just weired. In my case when I took a subversion update, I was getting this problem. The reason was the corruption of my project.properties file (due to subversion conflict). I just corrected the file and problem got solved.

Saurabh Verma
  • 6,328
  • 12
  • 52
  • 84
0

If you are using SVN or GIT please check whether the project.properties has conflicts or not. Sometimes project can not be open because of this.

Rukmal Dias
  • 3,242
  • 1
  • 34
  • 28
0

I hope this is useful to someone and saves his/her time: My colleague was facing same issue and we did almost everything mentioned here, with no luck. In the end we changed the Android SDK version in the manifest file and it worked.

araut
  • 576
  • 4
  • 11
0

This solution worked for me.

Close Eclipse and delete all .markers inside your workspace folder.

Restart Eclipse (once I had to restart it twice, it hang on the first but worked on the second for no aparent reason).

Of course, it's always safe to back them up first.

Dpedrinha
  • 3,741
  • 3
  • 38
  • 57