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">

10 Responses to “Eclipse, ADT, strings.xml and java.lang.NullPointerException”

  1. Chris Stahl Says:

    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. Cricket La Chica Says:

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

  3. Benny Bottema Says:

    Thank you!

    How did you find out about this though?

  4. Matt Says:

    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.

  5. pradep Says:

    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.

  6. xbox spel Says:

    Very useful data concerning these subject. I’ve found them with googling and also you seems number one of the subjects ! . . .

  7. Christopher Brandow Says:

    how to catch a cheating spouse said on November 24th, 2011 at 5:57 pm

  8. Leslie Journeay Says:

    I loved the post! really enjoyed it, If you need a hand with your SEO just let me know

  9. Nilda Versteegh Says:

    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.

  10. Luther Bonacci Says:

    Hi, XxFRYwc viagra generico

Leave a Reply