1
votes

When I try to debug my app I get a runtimeexception when I include this xml in my layout. I cannot see what is wrong with it, can you? I am using android eclipse plugin, eclipse 3.5.2, with the latest android plugin and the latest java 6...21 on winxppro 32 bit sp3 Thank you.

<ImageButton android:id="@+id/map_button"
  android:src="@drawable/bot_map"
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
  android:layout_weight="1"
  />

<ImageButton android:id="@+id/filter_button"
  android:src="@drawable/bot_filter"
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
  android:layout_weight="1"
  />

<ImageButton android:id="@+id/sort_button"
  android:src="@drawable/bot_sort"
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
  android:layout_weight="1"
  />

<ImageButton android:id="@+id/prev_button"
  android:src="@drawable/bot_arrow_prev"
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
  android:layout_weight="1"
  />


<ImageButton android:id="@+id/next_button"
  android:src="@drawable/bot_arrow_next"
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
  android:layout_weight="1"
  />

I also get these exceptions at the same time:

java.lang.IllegalArgumentException: Argument cannot be null at org.eclipse.swt.SWT.error(SWT.java:3865) at org.eclipse.swt.SWT.error(SWT.java:3799) at org.eclipse.swt.SWT.error(SWT.java:3770) at org.eclipse.swt.widgets.TreeItem.checkNull(TreeItem.java:205) at org.eclipse.swt.widgets.TreeItem.(TreeItem.java:195) at org.eclipse.gef.editparts.AbstractTreeEditPart.addChildVisual(AbstractTreeEditPart.java:75) at org.eclipse.gef.editparts.AbstractEditPart.addChild(AbstractEditPart.java:210) at org.eclipse.gef.editparts.AbstractEditPart.refreshChildren(AbstractEditPart.java:771) at org.eclipse.gef.editparts.AbstractEditPart.refresh(AbstractEditPart.java:718) at org.eclipse.gef.editparts.AbstractEditPart.addNotify(AbstractEditPart.java:252) at org.eclipse.gef.editparts.AbstractEditPart.addChild(AbstractEditPart.java:211) at org.eclipse.gef.editparts.RootTreeEditPart.setContents(RootTreeEditPart.java:140) at org.eclipse.gef.ui.parts.AbstractEditPartViewer.setContents(AbstractEditPartViewer.java:617) at org.eclipse.gef.ui.parts.AbstractEditPartViewer.setContents(AbstractEditPartViewer.java:626) at com.android.ide.eclipse.adt.internal.editors.layout.gle1.UiContentOutlinePage.reloadModel(Unknown Source) at com.android.ide.eclipse.adt.internal.editors.layout.LayoutEditor.xmlModelChanged(Unknown Source) at com.android.ide.eclipse.adt.internal.editors.AndroidXmlEditor$XmlModelStateListener.modelChanged(Unknown Source) at org.eclipse.wst.sse.core.internal.model.AbstractStructuredModel.fireModelChanged(AbstractStructuredModel.java:553) at org.eclipse.wst.sse.core.internal.model.AbstractStructuredModel.internalModelChanged(AbstractStructuredModel.java:887) at org.eclipse.wst.sse.core.internal.model.AbstractStructuredModel.changedModel(AbstractStructuredModel.java:382) at org.eclipse.wst.xml.core.internal.document.DOMModelImpl.changedModel(DOMModelImpl.java:167) at org.eclipse.wst.sse.core.internal.undo.StructuredTextUndoManager.undo(StructuredTextUndoManager.java:648) at org.eclipse.wst.sse.ui.StructuredTextViewerUndoManager.undo(StructuredTextViewerUndoManager.java:183) at org.eclipse.jface.text.TextViewer.doOperation(TextViewer.java:3938) at org.eclipse.jface.text.source.SourceViewer.doOperation(SourceViewer.java:921) at org.eclipse.jface.text.source.projection.ProjectionViewer.doOperation(ProjectionViewer.java:1533) at org.eclipse.wst.sse.ui.internal.StructuredTextViewer.doOperation(StructuredTextViewer.java:604) at org.eclipse.ui.texteditor.TextOperationAction$1.run(TextOperationAction.java:131) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) at org.eclipse.ui.texteditor.TextOperationAction.run(TextOperationAction.java:129) at org.eclipse.jface.action.Action.runWithEvent(Action.java:498) at org.eclipse.ui.commands.ActionHandler.execute(ActionHandler.java:185) at org.eclipse.ui.internal.handlers.LegacyHandlerWrapper.execute(LegacyHandlerWrapper.java:109) at org.eclipse.core.commands.Command.executeWithChecks(Command.java:476) at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508) at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:169) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeCommand(WorkbenchKeyboard.java:470) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.press(WorkbenchKeyboard.java:824) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.processKeyEvent(WorkbenchKeyboard.java:880) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.filterKeySequenceBindings(WorkbenchKeyboard.java:569) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.access$3(WorkbenchKeyboard.java:510) at org.eclipse.ui.internal.keys.WorkbenchKeyboard$KeyDownFilter.handleEvent(WorkbenchKeyboard.java:125) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Display.filterEvent(Display.java:1208) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1002) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1027) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1012) at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1040) at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1036) at org.eclipse.swt.widgets.Widget.wmChar(Widget.java:1368) at org.eclipse.swt.widgets.Control.WM_CHAR(Control.java:4053) at org.eclipse.swt.widgets.Canvas.WM_CHAR(Canvas.java:346) at org.eclipse.swt.widgets.Control.windowProc(Control.java:3946) at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:342) at org.eclipse.swt.widgets.Display.windowProc(Display.java:4619) at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method) at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2411) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3501) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2405) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2221) at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:493) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:194) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:368) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:559) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514) at org.eclipse.equinox.launcher.Main.run(Main.java:1311)

2
Can we see the enclosing layout for that code snippet?blindstuff
If that's your entire XML file then you're missing a root element - layout that contains all those buttons. If that's not the whole thing - please post your XML entirelyAsahi

2 Answers

1
votes

You can't have multiple root level nodes in XML

0
votes

Thanks for your time but the problem just up n went away after I updated my java to 6...22 and restarted everything.