Android SDK Content Loader failing with NullPointerException

I've just recently started getting an error any time I interact with the Android SDK and AVD Manager in Eclipse Helios

I've tried reinstalling the Eclipse plugin and the Android SDK but to no avail.

If I go to the "Installed packages" page and click refresh (or install or remove a package) I get a popup box saying that

'Android SDK Content Loader' has encountered a problem. 
parseSdkContent failed 
java.lang.NullPointerException.

Here is the full log:

Stack Trace

java.lang.NullPointerException
   at com.android.ide.eclipse.adt.internal.sdk.Sdk.loadTarget(Unknown Source)
   at com.android.ide.eclipse.adt.AdtPlugin$10.run(Unknown Source)
   at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

Session Data

eclipse.buildId=M20100909-0800
java.version=1.6.0_20
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=en_IE
Framework arguments:  -product org.eclipse.epp.package.java.product
Command-line arguments:  -os linux -ws gtk -arch x86 -product org.eclipse.epp.package.java.product

Has anyone else encountered this recently? It doesn't seem to be affecting actual Android development but its just kinda annoying.

Answers


The issue is in the your-avd-name.ini that is located at ...\<user-profile>\.android on your Windows machine (if you're Windows user). When any error occurs during the avd.ini parser, the Google ADT plugin tries to access a map that is null. The workaround is to delete the offending .ini file and recreate your avd(s).

This information was posted here: http://community.developer.motorola.com/t5/MOTODEV-Studio-for-Android/Android-SDK-Content-Loader-has-encountered-a-problem/td-p/6565


I solved the problem by deleting the .android directory in my user profile.


Solution:

Step 1. Find the folder named: > .android

This folder can be located in your Windows user directory, for example in Windows 7/8:

C:\Users\YOUR_WINDOWS_USERNAME.android

Step 2. Delete this folder .android

Step 3. Restart Eclipse and it is OK now


I solved the problem by deleting the .metadata folder from workspace


Go to C:/Users/<profile-name>/.avd and delete the .ini file of the AVD..Restart Eclipse.. otherwise if you don't know what file to delete or the above solution did not work for you, delete the entire created AVD folder..and restart eclipse..


The issue is in the your-avd-name.ini (config files) that is located at .android (search it)on your Windows machine (if you’re Windows user). When any error occurs during the avd.ini parser, the Google ADT plugin tries to access a map that is null. The workaround is to delete the offending .ini file and recreate your avd(s).


Try to delete .android folder from

C:\Users\Your User Name\.android

and open your eclipse and follow this Structure to configure your SDK for either installing new SDK or from installed one


I believe the trouble was with your ADT tools. If you had run eclipse plugin updates (which would update ADT), problem would have solved.


I get this parseSdkContent failed problem sometimes when I select improper values for a virtual device, if that improper value results in a blue screen of death upon AVD launch: After the crash when the computer restarts the "parseSdkContent failed" error will come when starting Eclipse.

This will give you all sorts of errors that does NOT at all give you any clue to the problem, from all the errors you may be tempted to reinstall Eclipse or even Java, but dont do that, it could be much simpler.

The solution for me is pretty simple: delete your .avd folder and the .ini file in ..Users\.android folder.

Backing up your AVD is therefore a good idea since it becomes corrupted if it crashes with Besod during launch.


Ok I've no idea exactly what I did but I used the standalone AVD manager (/tools/android from the command line) and un-installed most apart from the "Android SDK Tools, revision 2". And then reinstalled the parts I wanted and the error seems to have gone away.. Confused!


For some reasons my sdk/addons and sdk/platforms directories got corrupted and unreadable (computer crash), this caused my "'Android SDK Content Loader' has encountered a problem." error.

Had to delete/rename the entire sdk folder, download and install the sdk+packages again. In user/.android everything was fine.


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.


First start the emulator from command line

emulator -avd yourDeviceName

after doing above step in my case eclipse started fine.

UPDATE:

There is no perfect solution to this problem other than starting all over again. The issue is still open.


My solution was simply to go to help->look for updates-> and install all android related updates. Once done, I restarted Eclipse, it told me I need to start the SDK Manager to update some stuff, I clicked the "Open SDK Manager" button it shows me, updated the dev tools, platform tools, added some latest APIs and viola, all is fine :)


just try to delete the avd folder inside the .android folder, which may also have ur sdk folder in the path. Just delete the avd folder and try to configure ur path of the sdk in the eclipse > preference > android. then try to configure ur new avd in the eclipse by clicking the avd manager and then adding a new avd with a new name and click the start. Ur new avd device will launch.

Cheers Prakash


I have deleted the .android for windows user. if adb running stop it by adb kill-server and then delete the folder. this worked for me I am using adt-bundle-windows-x86 on window 7.

the issue is with AVD. AVD are saved under .android folder so after new installation of adt-bundle-windows-x86 we need to delete this folder also.


I'm on Windows 7; I got this error on first startup of ADT-provided Eclipse. My particular variant referenced an inability to write to a location on my C: drive. I solved it using the .metadata trick from above; then I chose "Run as Administrator" and everything worked fine after that.


i have solved the problem by deleting the newly created AVD(Android Virtual Device) in "C:\Users\EAST.android\avd" where \EAST is my user name, in avd folder you will find two folders for each device e.g. myDevice.avd and myDevice.ini delete both the files and run you eclipse again


Solved this by deleting metadata and .Android in workspace


Add following lines to .bashrc file.

export PATH=${PATH}:~/android-sdk-linux/tools
export PATH=${PATH}:~/android-sdk-linux/platform-tools

replace "~/android-sdk-linux" with path where you have saved the sdk folder.


This is a workaround (not exactly the solution). In Window > Preferences > Android > Lint Error Checking, uncheck "When saving files check for errors". I am sure this might work for you .


Had a similar problem. From one day to another I wasn't able to start my (so far) well working App. "SDK Content Loader" and "NullPointerException" Errors would pop up. Read the Answers here but didn't want to delete my .android or .metadata. I tried to clean my Project and - tadaa - it worked.

So, before you start deleting your plugins and stuff. Try a clean or restart and clean. Maybe this will already fix your issue. ;)


Need Your Help

Finding all the common substrings of given two strings

java string algorithm

I have come across a problem statement to find the all the common sub-strings between the given two sub-strings such a way that in every case you have to print the longest sub-string. The problem

How to get random value out of an array?

php arrays random

I have an array called $ran = array(1,2,3,4);