2011-02-15 102 views
1

我通過Android谷歌地圖教程這裏使用Eclipse 3.6和谷歌API的10修訂1.的Android佈局編輯器無法打開文件

但是,每當我嘗試編輯「main.xml中」文件,該http://developer.android.com/resources/tutorials/views/hello-mapview.html工作下面的錯誤是由編輯器拋出:

java.lang.NullPointerException 
    at com.android.ide.eclipse.adt.internal.editors.layout.gle2.GraphicalEditorPart.renderWithBridge(Unknown Source) 
    at com.android.ide.eclipse.adt.internal.editors.layout.gle2.GraphicalEditorPart.recomputeLayout(Unknown Source) 
    at com.android.ide.eclipse.adt.internal.editors.layout.gle2.GraphicalEditorPart.activated(Unknown Source) 
    at com.android.ide.eclipse.adt.internal.editors.layout.LayoutEditor.pageChange(Unknown Source) 
    at org.eclipse.ui.part.MultiPageEditorPart.setActivePage(MultiPageEditorPart.java:1067) 
    at org.eclipse.ui.forms.editor.FormEditor.setActivePage(FormEditor.java:607) 
    at org.eclipse.ui.part.MultiPageEditorPart.createPartControl(MultiPageEditorPart.java:352) 
    at org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:670) 
    at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:465) 
    at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:595) 
    at org.eclipse.ui.internal.EditorReference.getEditor(EditorReference.java:289) 
    at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2863) 
    at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2768) 
    at org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPage.java:2760) 
    at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.java:2711) 
    at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) 
    at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2707) 
    at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2691) 
    at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2674) 
    at org.eclipse.ui.ide.IDE.openEditor(IDE.java:683) 
    at com.android.ide.eclipse.adt.internal.wizards.newxmlfile.NewXmlFileWizard.performFinish(Unknown Source) 
    at org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDialog.java:811) 
    at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:430) 
    at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:624) 
    at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:234) 
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) 
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053) 
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4066) 
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3657) 
    at org.eclipse.jface.window.Window.runEventLoop(Window.java:825) 
    at org.eclipse.jface.window.Window.open(Window.java:801) 
    at org.eclipse.ui.internal.handlers.WizardHandler$New.executeHandler(WizardHandler.java:254) 
    at org.eclipse.ui.internal.handlers.WizardHandler.execute(WizardHandler.java:274) 
    at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:293) 
    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.handlers.SlaveHandlerService.executeCommand(SlaveHandlerService.java:241) 
    at org.eclipse.ui.internal.actions.CommandAction.runWithEvent(CommandAction.java:157) 
    at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584) 
    at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501) 
    at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411) 
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) 
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053) 
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4066) 
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3657) 
    at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2640) 
    at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604) 
    at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438) 
    at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671) 
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) 
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664) 
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) 
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115) 
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) 
    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:369) 
    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:619) 
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574) 
    at org.eclipse.equinox.launcher.Main.run(Main.java:1407) 

什麼我做錯了/可能的修復任何線索將不勝感激。

感謝

NigelT

+0

是您的Eclipse插件+是最新的? – ocodo 2011-02-15 09:00:27

回答

0

嗯,我不知道是什麼原因造成的問題,但它看起來是在Eclipse中圖形的XML編輯器的問題。作爲一種快速解決方法,您是否嘗試過在包資源管理器中右鍵單擊main.xml,然後執行'Open With -> Text Editor'

+0

使用Text或xml編輯器打開工作正常 - 看起來只是圖形編輯器變得困惑 – 2011-02-15 10:44:11

1

我剛剛有一些類似的問題。事實證明,我沒有正確安裝所有的網絡工具插件。考慮安裝Web工具:http://download.eclipse.org/webtools/repository/indigo/

(或.../helios/,如果這是你的Eclipse味)

如果你不喜歡我,只安裝的網絡工具部分,你以後可能會出現問題。如果您想加載完整內容,請返回並首先卸載部分安裝的插件。

卸載導航:

[Eclipse (Mac) || Help (Win)] -> About Eclipse SDK -> Installation Details -> Select Plugin -> Uninstall...

加裝導航:

Help -> Install New Software... -> Work with: <install URL>

相關問題