PDA

View Full Version : Eclipse android java.lang.NullPointerException



dantibb
July 25th, 2010, 01:16 PM
Trying to use eclipse with android sdk and plugin. All was working OK yesterday, Nothing has changed as far as am aware, but whenever I try to create new android project, if I go into res/values/strings.xml I get this error every time:
An error has occurred. See error log for more details.
java.lang.NullPointerException

Problems occurred when invoking code from plug-in: "org.eclipse.jface".

java.lang.NullPointerException
at org.eclipse.wst.xml.core.internal.document.Element Impl.getDefaultValue(ElementImpl.java:259)
at org.eclipse.wst.xml.core.internal.document.Element Impl.getAttributeNS(ElementImpl.java:329)
at com.android.ide.eclipse.adt.internal.editors.uimod el.UiElementNode.getShortDescription(Unknown Source)
at com.android.ide.eclipse.adt.internal.editors.ui.tr ee.UiModelTreeLabelProvider.getText(Unknown Source)
at org.eclipse.jface.viewers.WrappedViewerLabelProvid er.getText(WrappedViewerLabelProvider.java:10
at org.eclipse.jface.viewers.WrappedViewerLabelProvid er.update(WrappedViewerLabelProvider.java:164)
at org.eclipse.jface.viewers.ViewerColumn.refresh(Vie werColumn.java:152)
at org.eclipse.jface.viewers.AbstractTreeViewer.doUpd ateItem(AbstractTreeViewer.java:934)
at org.eclipse.jface.viewers.AbstractTreeViewer$Updat eItemSafeRunnable.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(SafeRunnab le.java:175)
at org.eclipse.jface.viewers.AbstractTreeViewer.doUpd ateItem(AbstractTreeViewer.java:1014)
at org.eclipse.jface.viewers.StructuredViewer$UpdateI temSafeRunnable.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(SafeRunnab le.java:175)
at org.eclipse.jface.viewers.StructuredViewer.updateI tem(StructuredViewer.java:2141)
at org.eclipse.jface.viewers.AbstractTreeViewer.updat eChildren(AbstractTreeViewer.java:2689)
at org.eclipse.jface.viewers.AbstractTreeViewer.inter nalRefreshStruct(AbstractTreeViewer.java:1867)
at org.eclipse.jface.viewers.TreeViewer.internalRefre shStruct(TreeViewer.java:721)
at org.eclipse.jface.viewers.AbstractTreeViewer.inter nalRefresh(AbstractTreeViewer.java:1842)
at org.eclipse.jface.viewers.AbstractTreeViewer.inter nalRefresh(AbstractTreeViewer.java:1799)
at org.eclipse.jface.viewers.AbstractTreeViewer.inter nalRefresh(AbstractTreeViewer.java:1785)
at org.eclipse.jface.viewers.StructuredViewer$7.run(S tructuredViewer.java:1487)
at org.eclipse.jface.viewers.StructuredViewer.preserv ingSelection(StructuredViewer.java:1422)
at org.eclipse.jface.viewers.TreeViewer.preservingSel ection(TreeViewer.java:403)
at org.eclipse.jface.viewers.StructuredViewer.preserv ingSelection(StructuredViewer.java:1383)
at org.eclipse.jface.viewers.StructuredViewer.refresh (StructuredViewer.java:1485)
at org.eclipse.jface.viewers.ColumnViewer.refresh(Col umnViewer.java:537)
at org.eclipse.jface.viewers.StructuredViewer.refresh (StructuredViewer.java:1444)
at org.eclipse.jface.viewers.ContentViewer.setContent Provider(ContentViewer.java:252)
at org.eclipse.jface.viewers.StructuredViewer.setCont entProvider(StructuredViewer.java:1641)
at org.eclipse.jface.viewers.AbstractTreeViewer.setCo ntentProvider(AbstractTreeViewer.java:2317)
at org.eclipse.jface.viewers.TreeViewer.setContentPro vider(TreeViewer.java:972)
at com.android.ide.eclipse.adt.internal.editors.ui.tr ee.UiTreeBlock.changeRootAndDescriptors(Unknown Source)
at com.android.ide.eclipse.adt.internal.editors.ui.tr ee.UiTreeBlock.createTreeViewer(Unknown Source)
at com.android.ide.eclipse.adt.internal.editors.ui.tr ee.UiTreeBlock.createMasterPart(Unknown Source)
at org.eclipse.ui.forms.MasterDetailsBlock.createCont ent(MasterDetailsBlock.java:161)
at org.eclipse.ui.forms.MasterDetailsBlock.createCont ent(MasterDetailsBlock.java:142)
at com.android.ide.eclipse.adt.internal.editors.resou rces.ResourcesTreePage.createFormContent(Unknown Source)
at org.eclipse.ui.forms.editor.FormPage$1.run(FormPag e.java:152)
at org.eclipse.swt.custom.BusyIndicator.showWhile(Bus yIndicator.java:70)
at org.eclipse.ui.forms.editor.FormPage.createPartCon trol(FormPage.java:150)
at org.eclipse.ui.forms.editor.FormEditor.pageChange( FormEditor.java:471)
at com.android.ide.eclipse.adt.internal.editors.Andro idEditor.pageChange(Unknown Source)
at org.eclipse.ui.part.MultiPageEditorPart.setActiveP age(MultiPageEditorPart.java:1067)
at org.eclipse.ui.forms.editor.FormEditor.setActivePa ge(FormEditor.java:603)
at org.eclipse.ui.part.MultiPageEditorPart.createPart Control(MultiPageEditorPart.java:352)
at org.eclipse.ui.internal.EditorReference.createPart Helper(EditorReference.java:670)
at org.eclipse.ui.internal.EditorReference.createPart (EditorReference.java:465)
at org.eclipse.ui.internal.WorkbenchPartReference.get Part(WorkbenchPartReference.java:595)
at org.eclipse.ui.internal.PartPane.setVisible(PartPa ne.java:313)
at org.eclipse.ui.internal.presentations.PresentableP art.setVisible(PresentablePart.java:180)
at org.eclipse.ui.internal.presentations.util.Present ablePartFolder.select(PresentablePartFolder.java:2 70)
at org.eclipse.ui.internal.presentations.util.LeftToR ightTabOrder.select(LeftToRightTabOrder.java:65)
at org.eclipse.ui.internal.presentations.util.TabbedS tackPresentation.selectPart(TabbedStackPresentatio n.java:473)
at org.eclipse.ui.internal.PartStack.refreshPresentat ionSelection(PartStack.java:1254)
at org.eclipse.ui.internal.PartStack.setSelection(Par tStack.java:1207)
at org.eclipse.ui.internal.PartStack.showPart(PartSta ck.java:1606)
at org.eclipse.ui.internal.PartStack.add(PartStack.ja va:497)
at org.eclipse.ui.internal.EditorStack.add(EditorStac k.java:103)
at org.eclipse.ui.internal.PartStack.add(PartStack.ja va:483)
at org.eclipse.ui.internal.EditorStack.add(EditorStac k.java:112)
at org.eclipse.ui.internal.EditorSashContainer.addEdi tor(EditorSashContainer.java:63)
at org.eclipse.ui.internal.EditorAreaHelper.addToLayo ut(EditorAreaHelper.java:225)
at org.eclipse.ui.internal.EditorAreaHelper.addEditor (EditorAreaHelper.java:213)
at org.eclipse.ui.internal.EditorManager.createEditor Tab(EditorManager.java:778)
at org.eclipse.ui.internal.EditorManager.openEditorFr omDescriptor(EditorManager.java:677)
at org.eclipse.ui.internal.EditorManager.openEditor(E ditorManager.java:638)
at org.eclipse.ui.internal.WorkbenchPage.busyOpenEdit orBatched(WorkbenchPage.java:2860)
at org.eclipse.ui.internal.WorkbenchPage.busyOpenEdit or(WorkbenchPage.java:2768)
at org.eclipse.ui.internal.WorkbenchPage.access$11(Wo rkbenchPage.java:2760)
at org.eclipse.ui.internal.WorkbenchPage$10.run(Workb enchPage.java:2711)
at org.eclipse.swt.custom.BusyIndicator.showWhile(Bus yIndicator.java:70)
at org.eclipse.ui.internal.WorkbenchPage.openEditor(W orkbenchPage.java:2707)
at org.eclipse.ui.internal.WorkbenchPage.openEditor(W orkbenchPage.java:2691)
at org.eclipse.ui.internal.WorkbenchPage.openEditor(W orkbenchPage.java:2682)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:651)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:610)
at org.eclipse.jdt.internal.ui.javaeditor.EditorUtili ty.openInEditor(EditorUtility.java:365)
at org.eclipse.jdt.internal.ui.javaeditor.EditorUtili ty.openInEditor(EditorUtility.java:168)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenActi on.java:229)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenActi on.java:20
at org.eclipse.jdt.ui.actions.SelectionDispatchAction .dispatchRun(SelectionDispatchAction.java:274)
at org.eclipse.jdt.ui.actions.SelectionDispatchAction .run(SelectionDispatchAction.java:250)
at org.eclipse.jdt.internal.ui.packageview.PackageExp lorerActionGroup.handleOpen(PackageExplorerActionG roup.java:373)
at org.eclipse.jdt.internal.ui.packageview.PackageExp lorerPart$4.open(PackageExplorerPart.java:526)
at org.eclipse.ui.OpenAndLinkWithEditorHelper$Interna lListener.open(OpenAndLinkWithEditorHelper.java:4
at org.eclipse.jface.viewers.StructuredViewer$2.run(S tructuredViewer.java:845)
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(SafeRunnab le.java:175)
at org.eclipse.jface.viewers.StructuredViewer.fireOpe n(StructuredViewer.java:843)
at org.eclipse.jface.viewers.StructuredViewer.handleO pen(StructuredViewer.java:1131)
at org.eclipse.jface.viewers.StructuredViewer$6.handl eOpen(StructuredViewer.java:1235)
at org.eclipse.jface.util.OpenStrategy.fireOpenEvent( OpenStrategy.java:264)
at org.eclipse.jface.util.OpenStrategy.access$2(OpenS trategy.java:258)
at org.eclipse.jface.util.OpenStrategy$1.handleEvent( OpenStrategy.java:298)
at org.eclipse.swt.widgets.EventTable.sendEvent(Event Table.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.ja va:1258)
at org.eclipse.swt.widgets.Display.runDeferredEvents( Display.java:3552)
at org.eclipse.swt.widgets.Display.readAndDispatch(Di splay.java:3171)
at org.eclipse.ui.internal.Workbench.runEventLoop(Wor kbench.java:2629)
at org.eclipse.ui.internal.Workbench.runUI(Workbench. java:2593)
at org.eclipse.ui.internal.Workbench.access$4(Workben ch.java:2427)
at org.eclipse.ui.internal.Workbench$7.run(Workbench. java:670)
at org.eclipse.core.databinding.observable.Realm.runW ithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWork bench(Workbench.java:663)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(Pl atformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplica tion.start(IDEApplication.java:115)
at org.eclipse.equinox.internal.app.EclipseAppHandle. run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseA ppLauncher.runApplication(EclipseAppLauncher.java: 110)
at org.eclipse.core.runtime.internal.adaptor.EclipseA ppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.ru n(EclipseStarter.java:369)
at org.eclipse.core.runtime.adaptor.EclipseStarter.ru n(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.equinox.launcher.Main.invokeFramework( Main.java:619)
at org.eclipse.equinox.launcher.Main.basicRun(Main.ja va:574)
at org.eclipse.equinox.launcher.Main.run(Main.java:14 07)
I have tried deleting ecplise and downloading again (i downloaded the package rather than install through package manager), also deleting and re-installing android sdk, and re-installing java packages, all to no avail.

Can anyone point me in the right direction, its pretty frustrating!

Thanks!

mainerror
July 25th, 2010, 02:45 PM
Which Java version do you use? I mean where did you get it from?

dantibb
July 28th, 2010, 08:59 PM
From package manager - Java 6

auxbuss
July 29th, 2010, 10:45 PM
I'm saw exactly the same thing. I left strings.xml open, then restarted eclipse, and it went away. I'm not confident that it won't come back, but thought you might like to know that you are not alone.

dantibb
August 2nd, 2010, 08:14 PM
Hi,

Am still unable to get eclipse back running. Has anyone seen this anywhere else on the internet. I have tried clean install of java, eclipse etc, but not getting anywhere.

Here is a bit more information on the java currently installed. Sorry if info is a bit sparse, I do not have access to this machine all the time.



$ sudo update-alternatives --config java
[sudo] password for daniel:
There are 2 choices for the alternative java (providing /usr/bin/java).

Selection Path Priority Status
------------------------------------------------------------
0 /usr/lib/jvm/java-6-openjdk/jre/bin/java 1061 auto mode
* 1 /usr/lib/jvm/java-6-openjdk/jre/bin/java 1061 manual mode
2 /usr/lib/jvm/java-6-sun/jre/bin/java 63 manual mode

Press enter to keep the current choice
, or type selection number: ^C

gophergun
August 3rd, 2010, 09:06 PM
I'm having exactly the same issue. Admittedly, I'm on Windows at the moment, but I suspect the cause is the same.

sealskej
August 6th, 2010, 08:22 PM
Same here, running Windows 7.

lilyruo
August 11th, 2010, 07:17 PM
I have same issue. I also tried leave strings.xml open and restart, and it works fine after that.

WitchCraft
August 11th, 2010, 11:49 PM
Try IDA Pro Advances for Linux.
It now comes with the android plugin preinstalled.

You then only need to configure the emulator.

dantibb
August 15th, 2010, 11:56 AM
Hi,

Still haven't got to the bottom of what happened, but I started eclipse up with a new workspace and this appears to have resolved......

Thanks.

mulpuru
August 15th, 2010, 07:24 PM
Navigate to

Window -> Preferences -> XML -> XML Files -> Editor

and uncheck "Use Inferred grammar ................"

syed.rakib.al.hasan
December 22nd, 2010, 06:48 PM
i just reinstalled the already installed java packages from the Synaptic Package manager (JDK - JRE - bin - etc).
and that seemed to have worked out perfectly.

peterlwl
January 15th, 2011, 07:59 AM
i tell you the solution:

peterlwl
January 15th, 2011, 08:02 AM
try this: project->clean-> clean all projects
good luck