I have exactly the same problem.

Whever I open string.xml and some other xml files I also get a Java
Null Pointer error. Typing even a single character triggers it.

I can look at them fine as xml, but Resources view is broken - the
left hand pane has the thin lines that should connect the elements in
the tree structure, but no elements listed. Saving the file also
creates null pointer errors.

You can use editors that don't have a graphical view in the left hand
window - for example the xml editor works fine. Unfortunately the more
useful editors all show heirarchies and don't work.

It is true even for the default files created by new -> android
project.

As I say, the xml itself looks fine; its related to how the
information is shown in the left hand window; if it uses a tree
representation of the data, it throws a Null Pointer exception..

Whatever it is, its a PITA. I would completely remove and re-install
the whole devel environment if I was sure it would fix it.

Peter Webb



On Jul 1, 2:42 pm, Bob Kerns <[email protected]> wrote:
> There are several possible editors to use to edit these files. I'd
> suggest trying a different one.
>
> First, close the editor that's giving you problems.
>
> Right click on thefilein the Project Explorer, and choose Open
> With...   Try "Android Resource Editor" first, as that's probably the
> one you really want to be using, and there's nothing in the stacktrace
> that suggests that's what you're actually using. I'm not sure it's NOT
> using it, but it's worth trying the right one first.
>
> If that doesn't work, try another one. Text Editor is likely to work.
> System Editor/ and In Place Editor will depend on what's installed on
> your system, and since you're on a Mac, I won't make any predictions
> there, but might be good choices. System Editor will launch a separate
> window, which is a drawback.
>
> I have OxygenXML installed, and that providesEclipsewith an
> additionalXMLeditor as well, with the Oxygen toolset and editing
> style available.
>
> Even if the Android tool is broken, explore and I think you'll
> probably find something that works acceptably for you.
>
> (It's still a bug, even if you are using the "wrong" editor. A side
> benefit of exploring is you'll identify the culprit and canfilethe
> suitable bug report!)
>
> On Jun 29, 9:46 pm, Gorman Ho <[email protected]> wrote:
>
>
>
> > I am also experiencing this issue. When I edit strings.xmldirectly, I
> > get 1 NullPointerException for each string in thefileeach time I
> > type a letter. I eventually did something to make it go away, but I'm
> > not sure what. However, I'm able to reproduce the behavior by creating
> > a new Android project.
>
> > I'm running Leopard,EclipseHelios, Android SDK r06, Android Platform
> > 2.2, ADT 0.9.7.
>
> > I pasted the requested logfilebelow. I had 2 strings in strings.xml,
> > so there were 2 NullPointerExeptions generated when I typed a letter
> > in strings.xml.
>
> > Hope that helps
> > Gorman
>
> > !ENTRY org.eclipse.jface 4 2 2010-06-29 22:43:12.696
> > !MESSAGE Problems occurred when invoking code from plug-in:
> > "org.eclipse.jface".
> > !STACK 0
> > java.lang.NullPointerException
> >         at
> > org.eclipse.wst.xml.core.internal.document.ElementImpl.getDefaultValue(Elem 
> > entImpl.java:
> > 259)
> >         at
> > org.eclipse.wst.xml.core.internal.document.ElementImpl.getAttributeNS(Eleme 
> > ntImpl.java:
> > 329)
> >         at
> > com.android.ide.eclipse.adt.internal.editors.uimodel.UiElementNode.getShort 
> > Description(Unknown
> > Source)
> >         at
> > com.android.ide.eclipse.adt.internal.editors.ui.tree.UiModelTreeLabelProvid 
> > er.getText(Unknown
> > Source)
> >         at
> > org.eclipse.jface.viewers.WrappedViewerLabelProvider.getText(WrappedViewerL 
> > abelProvider.java:
> > 108)
> >         at
> > org.eclipse.jface.viewers.WrappedViewerLabelProvider.update(WrappedViewerLa 
> > belProvider.java:
> > 164)
> >         at org.eclipse.jface.viewers.ViewerColumn.refresh(ViewerColumn.java:
> > 152)
> >         at
> > org.eclipse.jface.viewers.AbstractTreeViewer.doUpdateItem(AbstractTreeViewe 
> > r.java:
> > 934)
> >         at org.eclipse.jface.viewers.AbstractTreeViewer
> > $UpdateItemSafeRunnable.run(AbstractTreeViewer.java:102)
> >         at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
> >         at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:49)
> >         at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175)
> >         at
> > org.eclipse.jface.viewers.AbstractTreeViewer.doUpdateItem(AbstractTreeViewe 
> > r.java:
> > 1014)
> >         at org.eclipse.jface.viewers.StructuredViewer
> > $UpdateItemSafeRunnable.run(StructuredViewer.java:481)
> >         at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
> >         at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:49)
> >         at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175)
> >         at
> > org.eclipse.jface.viewers.StructuredViewer.updateItem(StructuredViewer.java 
> > :
> > 2141)
> >         at
> > org.eclipse.jface.viewers.AbstractTreeViewer.updateChildren(AbstractTreeVie 
> > wer.java:
> > 2689)
> >         at
> > org.eclipse.jface.viewers.AbstractTreeViewer.internalRefreshStruct(Abstract 
> > TreeViewer.java:
> > 1867)
> >         at
> > org.eclipse.jface.viewers.TreeViewer.internalRefreshStruct(TreeViewer.java:
> > 721)
> >         at
> > org.eclipse.jface.viewers.AbstractTreeViewer.internalRefresh(AbstractTreeVi 
> > ewer.java:
> > 1842)
> >         at
> > org.eclipse.jface.viewers.AbstractTreeViewer.internalRefresh(AbstractTreeVi 
> > ewer.java:
> > 1799)
> >         at
> > org.eclipse.jface.viewers.AbstractTreeViewer.internalRefresh(AbstractTreeVi 
> > ewer.java:
> > 1785)
> >         at org.eclipse.jface.viewers.StructuredViewer
> > $7.run(StructuredViewer.java:1487)
> >         at
> > org.eclipse.jface.viewers.StructuredViewer.preservingSelection(StructuredVi 
> > ewer.java:
> > 1422)
> >         at
> > org.eclipse.jface.viewers.TreeViewer.preservingSelection(TreeViewer.java:
> > 403)
> >         at
> > org.eclipse.jface.viewers.StructuredViewer.preservingSelection(StructuredVi 
> > ewer.java:
> > 1383)
> >         at
> > org.eclipse.jface.viewers.StructuredViewer.refresh(StructuredViewer.java:
> > 1485)
> >         at org.eclipse.jface.viewers.ColumnViewer.refresh(ColumnViewer.java:
> > 537)
> >         at
> > org.eclipse.jface.viewers.StructuredViewer.refresh(StructuredViewer.java:
> > 1444)
> >         at com.android.ide.eclipse.adt.internal.editors.ui.tree.UiTreeBlock
> > $2.uiElementNodeUpdated(Unknown Source)
> >         at
> > com.android.ide.eclipse.adt.internal.editors.uimodel.UiElementNode.invokeUi 
> > UpdateListeners(Unknown
> > Source)
> >         at
> > com.android.ide.eclipse.adt.internal.editors.uimodel.UiElementNode.load>From
> >  XmlNode(Unknown
> > Source)
> >         at
> > com.android.ide.eclipse.adt.internal.editors.resources.ResourcesEditor.xmlM 
> > odelChanged(Unknown
> > Source)
> >         at com.android.ide.eclipse.adt.internal.editors.AndroidEditor
> > $XmlModelStateListener.modelChanged(Unknown Source)
> >         at
> > org.eclipse.wst.sse.core.internal.model.AbstractStructuredModel.fireModelCh 
> > anged(AbstractStructuredModel.java:
> > 553)
> >         at
> > org.eclipse.wst.sse.core.internal.model.AbstractStructuredModel.internalMod 
> > elChanged(AbstractStructuredModel.java:
> > 887)
> >         at
> > org.eclipse.wst.sse.core.internal.model.AbstractStructuredModel.changedMode 
> > l(AbstractStructuredModel.java:
> > 382)
> >         at
> > org.eclipse.wst.xml.core.internal.document.DOMModelImpl.changedModel(DOMMod 
> > elImpl.java:
> > 167)
> >         at org.eclipse.wst.sse.core.internal.model.AbstractStructuredModel
> > $DocumentToModelNotifier.regionsReplaced(AbstractStructuredModel.java:
> > 176)
> >         at
> > org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument._fireEvent(B 
> > asicStructuredDocument.java:
> > 571)
> >         at
> > org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument.fireStructur 
> > edDocumentEvent(BasicStructuredDocument.java:
> > 1190)
> >         at
> > org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument.internalRepl 
> > aceText(BasicStructuredDocument.java:
> > 1968)
> >         at
> > org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument.replaceText( 
> > BasicStructuredDocument.java:
> > 2419)
> >         at
> > org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument.replaceText( 
> > BasicStructuredDocument.java:
> > 2404)
> >         at
> > org.eclipse.wst.sse.core.internal.text.JobSafeStructuredDocument.access
> > $2(JobSafeStructuredDocument.java:1)
> >         at org.eclipse.wst.sse.core.internal.text.JobSafeStructuredDocument
> > $3.run(JobSafeStructuredDocument.java:141)
> >         at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
> >         at
> > org.eclipse.wst.sse.ui.EditorExecutionContext.execute(EditorExecutionContex 
> > t.java:
> > 149)
> >         at
> > org.eclipse.wst.sse.core.internal.text.JobSafeStructuredDocument.replaceTex 
> > t(JobSafeStructuredDocument.java:
> > 144)
> >         at
> > org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument.replace(Basi 
> > cStructuredDocument.java:
> > 2364)
> >         at
> > org.eclipse.wst.sse.core.internal.text.JobSafeStructuredDocument.access
> > $0(JobSafeStructuredDocument.java:1)
> >         at org.eclipse.wst.sse.core.internal.text.JobSafeStructuredDocument
> > $1.run(JobSafeStructuredDocument.java:103)
> >         at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
> >         at
> > org.eclipse.wst.sse.ui.EditorExecutionContext.execute(EditorExecutionContex 
> > t.java:
> > 149)
> >         at
> > org.eclipse.wst.sse.core.internal.text.JobSafeStructuredDocument.replace(Jo 
> > bSafeStructuredDocument.java:
> > 106)
> >         at
> > org.eclipse.jface.text.projection.ProjectionTextStore.replace(ProjectionTex 
> > tStore.java:
> > 111)
> >         at
> > org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:
> > 1184)
> >         at
> > org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:
> > 1210)
> >         at
> > org.eclipse.jface.text.projection.ProjectionDocument.replace(ProjectionDocu 
> > ment.java:
> > 629)
> >         at
> > org.eclipse.jface.text.DefaultDocumentAdapter.replaceTextRange(DefaultDocum 
> > entAdapter.java:
> > 248)
> >         at org.eclipse.swt.custom.StyledText.modifyContent(StyledText.java:
> > 7168)
> >         at org.eclipse.swt.custom.StyledText.sendKeyEvent(StyledText.java:
> > 7975)
> >         at org.eclipse.swt.custom.StyledText.doBackspace(StyledText.java:
> > 2267)
> >         at org.eclipse.swt.custom.StyledText.invokeAction(StyledText.java:
> > 6976)
> >         at org.eclipse.swt.custom.StyledText.handleKey(StyledText.java:5932)
> >         at org.eclipse.swt.custom.StyledText.handleKeyDown(StyledText.java:
> > 5958)
> >         at org.eclipse.swt.custom.StyledText$7.handleEvent(StyledText.java:
> > 5652)
> >         at
>
> ...
>
> read more »- Hide quoted text -
>
> - Show quoted text -

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to