Eclipse在创建android junit测试配置时抛出java.lang.NullPointerException

Eclipse在创建android junit测试配置时抛出java.lang.NullPointerException,android,eclipse,junit,run-configuration,Android,Eclipse,Junit,Run Configuration,我在Eclipse中有一个Android项目 我为我的项目创建了测试项目 尝试创建在中写入的测试配置 我的行动: 运行->运行配置 选择Android JUnit测试->新建 出现错误消息“发生错误。有关详细信息,请参阅错误日志。java.lang.NullPointerException” 日志: Problems occurred when invoking code from plug-in: "org.eclipse.jface". java.lang.NullPointerExce

我在Eclipse中有一个Android项目

我为我的项目创建了测试项目 尝试创建在中写入的测试配置

我的行动:

  • 运行->运行配置
  • 选择Android JUnit测试->新建
  • 出现错误消息“发生错误。有关详细信息,请参阅错误日志。java.lang.NullPointerException”
  • 日志:

    Problems occurred when invoking code from plug-in: "org.eclipse.jface".
    
    java.lang.NullPointerException
    at com.android.ide.eclipse.adt.internal.launch.junit.InstrumentationRunnerValidator.<init>(InstrumentationRunnerValidator.java:48)
    at com.android.ide.eclipse.adt.internal.launch.junit.InstrumentationRunnerValidator.<init>(InstrumentationRunnerValidator.java:59)
    at com.android.ide.eclipse.adt.internal.launch.junit.AndroidJUnitLaunchConfigurationTab.loadInstrumentations(AndroidJUnitLaunchConfigurationTab.java:954)
    at com.android.ide.eclipse.adt.internal.launch.junit.AndroidJUnitLaunchConfigurationTab.initializeFrom(AndroidJUnitLaunchConfigurationTab.java:335)
    at org.eclipse.debug.ui.AbstractLaunchConfigurationTabGroup.initializeFrom(AbstractLaunchConfigurationTabGroup.java:86)
    at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationTabGroupWrapper.initializeFrom(LaunchConfigurationTabGroupWrapper.java:194)
    at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationTabGroupViewer.displayInstanceTabs(LaunchConfigurationTabGroupViewer.java:751)
    at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationTabGroupViewer$8.run(LaunchConfigurationTabGroupViewer.java:623)
    at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
    at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationTabGroupViewer.inputChanged(LaunchConfigurationTabGroupViewer.java:640)
    at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationTabGroupViewer.setInput0(LaunchConfigurationTabGroupViewer.java:602)
    at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationTabGroupViewer.setInput(LaunchConfigurationTabGroupViewer.java:578)
    at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsDialog.handleLaunchConfigurationSelectionChanged(LaunchConfigurationsDialog.java:941)
    at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsDialog$3.selectionChanged(LaunchConfigurationsDialog.java:560)
    at org.eclipse.jface.viewers.StructuredViewer$3.run(StructuredViewer.java:888)
    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.firePostSelectionChanged(StructuredViewer.java:886)
    at org.eclipse.jface.viewers.StructuredViewer.setSelection(StructuredViewer.java:1726)
    at org.eclipse.jface.viewers.TreeViewer.setSelection(TreeViewer.java:1139)
    at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationView.handleConfigurationAdded(LaunchConfigurationView.java:283)
    at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationView.access$1(LaunchConfigurationView.java:272)
    at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationView$2.run(LaunchConfigurationView.java:261)
    at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
    at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135)
    at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4140)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3757)
    at org.eclipse.jface.window.Window.runEventLoop(Window.java:825)
    at org.eclipse.jface.window.Window.open(Window.java:801)
    at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsDialog.open(LaunchConfigurationsDialog.java:1132)
    at org.eclipse.debug.ui.DebugUITools$2.run(DebugUITools.java:579)
    at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
    at org.eclipse.debug.ui.DebugUITools.openLaunchConfigurationDialogOnGroup(DebugUITools.java:587)
    at org.eclipse.debug.ui.DebugUITools.openLaunchConfigurationDialogOnGroup(DebugUITools.java:521)
    at org.eclipse.debug.ui.actions.OpenLaunchDialogAction.run(OpenLaunchDialogAction.java:81)
    at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
    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:4165)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3754)
    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.views.log.EventDetailsDialog.open(EventDetailsDialog.java:180)
    at org.eclipse.ui.internal.views.log.EventDetailsDialogAction.run(EventDetailsDialogAction.java:98)
    at org.eclipse.ui.internal.views.log.LogView$15.doubleClick(LogView.java:535)
    at org.eclipse.jface.viewers.StructuredViewer$1.run(StructuredViewer.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(SafeRunnable.java:175)
    at org.eclipse.jface.viewers.StructuredViewer.fireDoubleClick(StructuredViewer.java:843)
    at org.eclipse.jface.viewers.AbstractTreeViewer.handleDoubleSelect(AbstractTreeViewer.java:1462)
    at org.eclipse.jface.viewers.StructuredViewer$4.widgetDefaultSelected(StructuredViewer.java:1246)
    at org.eclipse.jface.util.OpenStrategy.fireDefaultSelectionEvent(OpenStrategy.java:249)
    at org.eclipse.jface.util.OpenStrategy.access$0(OpenStrategy.java:246)
    at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:307)
    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:4165)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3754)
    at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2696)
    at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2660)
    at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494)
    at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)
    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:344)
    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:622)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1386)
    
    从插件“org.eclipse.jface”调用代码时出现问题。
    java.lang.NullPointerException
    位于com.android.ide.eclipse.adt.internal.launch.junit.InstrumentationRunnerValidator.(InstrumentationRunnerValidator.java:48)
    位于com.android.ide.eclipse.adt.internal.launch.junit.InstrumentationRunnerValidator.(InstrumentationRunnerValidator.java:59)
    在com.android.ide.eclipse.adt.internal.launch.junit.androidJUnitLanchConfigurationTab.loadInstrumentations(androidJUnitLanchConfigurationTab.java:954)
    在com.android.ide.eclipse.adt.internal.launch.junit.androidjunitlanchconfigurationtab.initializeFrom(androidjunitlanchconfigurationtab.java:335)
    位于org.eclipse.debug.ui.AbstractLaunchConfigurationTabGroup.initializeFrom(AbstractLaunchConfigurationTabGroup.java:86)
    在org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationTabGroupWrapper.initializeFrom(LaunchConfigurationTabGroupWrapper.java:194)
    在org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationTabGroupViewer.displayInstanceTabs上(LaunchConfigurationTabGroupViewer.java:751)
    位于org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationTabGroupViewer$8.run(LaunchConfigurationTabGroupViewer.java:623)
    位于org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
    位于org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationTabGroupViewer.inputChanged(LaunchConfigurationTabGroupViewer.java:640)
    位于org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationTabGroupViewer.setInput0(LaunchConfigurationTabGroupViewer.java:602)
    位于org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationTabGroupViewer.setInput(LaunchConfigurationTabGroupViewer.java:578)
    位于org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsDialog.handleLaunchConfigurationSelectionChanged(LaunchConfigurationsDialog.java:941)
    在org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsDialog$3.selectionChanged(LaunchConfigurationsDialog.java:560)
    位于org.eclipse.jface.viewers.StructuredViewer$3.run(StructuredViewer.java:888)
    位于org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    位于org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:49)
    位于org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175)
    查看org.eclipse.jface.viewers.StructuredViewer.firePostSelectionChanged(StructuredViewer.java:886)
    位于org.eclipse.jface.viewers.StructuredViewer.setSelection(StructuredViewer.java:1726)
    在org.eclipse.jface.viewers.TreeViewer.setSelection上(TreeViewer.java:1139)
    在org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationView.handleConfigurationAdded上(LaunchConfigurationView.java:283)
    位于org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationView.access$1(LaunchConfigurationView.java:272)
    位于org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationView$2.run(LaunchConfigurationView.java:261)
    位于org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
    位于org.eclipse.swt.widgets.Synchronizer.runasynchmessages(Synchronizer.java:135)
    在org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4140)上
    在org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3757)上
    位于org.eclipse.jface.window.window.runEventLoop(window.java:825)
    位于org.eclipse.jface.window.window.open(window.java:801)
    位于org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsDialog.open(LaunchConfigurationsDialog.java:1132)
    位于org.eclipse.debug.ui.DebugUITools$2.run(DebugUITools.java:579)
    位于org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
    位于org.eclipse.debug.ui.DebugUITools.openLaunchConfigurationDialogOnGroup(DebugUITools.java:587)
    位于org.eclipse.debug.ui.DebugUITools.openLaunchConfigurationDialogOnGroup(DebugUITools.java:521)
    位于org.eclipse.debug.ui.actions.OpenLaunchDialogAction.run(OpenLaunchDialogAction.java:81)
    位于org.eclipse.jface.action.action.runWithEvent(action.java:498)
    位于org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
    访问org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
    位于org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
    位于org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    位于org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
    位于org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4165)
    在org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3754)上
    位于org.eclipse.jface.window.window.runEventLoop(window.java:825)
    位于org.eclipse.jface.window.window.open(window.java:801)
    在org.eclipse.ui.internal.views.log.EventDetailsDialog.open(EventDetailsDialog.java:180)上
    位于org.eclipse.ui.internal.views.log.EventDetailsDialogAction.run(EventDetailsDialogAction.java:98)
    在org.eclipse.ui.internal.views.log.LogView$15.doubleClick(LogView.java:535)
    位于org.eclipse.jface.viewers.StructuredViewer$1.run(StructuredViewer.java:845)
    位于org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    位于org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:49)
    位于org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175)
    在org.eclipse.jface.viewers.StructuredViewer.fireDoubleClick上(StructuredViewer.java:843)
    位于org.eclipse.jface.viewers.AbstractTreeViewer.handleDoubleSelect(AbstractTreeViewer.java:1462)
    位于org.eclipse.jface.viewers.StructuredViewer$4.widgetDefaultSelected(StructuredViewer.java:1246)
    在org.eclipse.jface.util.OpenStrategy.fireDefaultSelectionEvent(OpenStrategy。
    
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
        <launchConfiguration type="com.android.ide.eclipse.adt.junit.launchConfigurationType">
        <stringAttribute key="com.android.ide.eclipse.adt.commandline" value=""/>
        <intAttribute key="com.android.ide.eclipse.adt.delay" value="0"/>
        <booleanAttribute key="com.android.ide.eclipse.adt.nobootanim" value="false"/>
        <intAttribute key="com.android.ide.eclipse.adt.speed" value="0"/>
        <stringAttribute key="com.android.ide.eclipse.adt.target" value="AUTO"/>
        <booleanAttribute key="com.android.ide.eclipse.adt.wipedata" value="false"/>
        <stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value=""/>
        <stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value=""/>
        <stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="GemsTest"/>
    </launchConfiguration>