Eclipse, ADT, strings.xml and java.lang.NullPointerException

On a clean installation of Eclipse and the Android Development Tools (ADT), and for a new Android project, when trying to edit the strings.xml file, a java.lang.NullPointerException is thrown.

To fix the problem, edit strings.xml directly, bypassing the GUI, by double clicking the file in the Eclipse workbench, then selecting strings.xml from the tab at the bottom. Then, replace the line that reads:

<resources>

with

<resources xmlns:android="http://schemas.android.com/apk/res/android">

12 thoughts on “Eclipse, ADT, strings.xml and java.lang.NullPointerException

  1. First off, thank you for the tip! I got tired of trying to type a single letter and then acknowledge the error.

    Secondly, how and why does this work and will I need to do this with every project that I create?

  2. This was very helpful, thank you! May I second Chris Stahl’s question and ask how this fixed the problem?

  3. Had the same issue before and I found the fix because I had a sample project that the error didnt happen to and noticed that xmlns attribute. Im guessing the poster noticed it the same way.

  4. Until then, go to the XML/XML Files/Editor preference page and turn
    off the “Use inferred grammar…” setting. It should only affect
    content assist and possibly some of the Outline view and Design page’s
    context menu actions. Or refer to a DTD or XML Schema in the XML
    file. We’ll have this corrected in Helios SR1/WTP 3.2.2.

  5. Wonderful goods from you, man. I’ve understand your stuff previous to and you’re just too magnificent. I really like what you’ve acquired here, certainly like what you’re saying and the way in which you say it. You make it entertaining and you still take care of to keep it sensible. I can’t wait to read much more from you. This is actually a great web site.

  6. I’ve look at several decent products below. Without a doubt price bookmarking for revisiting. I surprise the amount of concentration you put for making such an amazing instructive website.

  7. The very heart of your writing while sounding reasonable in the beginning, did not settle well with me after some time. Someplace within the paragraphs you actually managed to make me a believer unfortunately only for a short while. I nevertheless have got a problem with your jumps in logic and one might do well to fill in those gaps. In the event you actually can accomplish that, I could certainly end up being fascinated.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s