3

我正在尝试使用 Eclipse 中的 Android 工具 > 重命名应用程序包选项来测试我对平板电脑上 FBReaderJ 的更改,同时保持官方版本可用。当我使用此命令并输入新名称时,出现错误:

An unexpected exception occurred while creating a change object. See the error log for more details.

在错误日志中,我有:

Internal Error

堆栈跟踪:

    java.lang.reflect.InvocationTargetException
    at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:421)
    at org.eclipse.ui.internal.WorkbenchWindow$13.run(WorkbenchWindow.java:1675)
    at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
    at org.eclipse.ui.internal.WorkbenchWindow.run(WorkbenchWindow.java:1672)
    at org.eclipse.ltk.ui.refactoring.RefactoringWizard.createChange(RefactoringWizard.java:663)
    at org.eclipse.ltk.ui.refactoring.RefactoringWizard.computeUserInputSuccessorPage(RefactoringWizard.java:502)
    at org.eclipse.ltk.ui.refactoring.RefactoringWizard.getStartingPage(RefactoringWizard.java:472)
    at org.eclipse.jface.wizard.WizardDialog.showStartingPage(WizardDialog.java:1271)
    at org.eclipse.jface.wizard.WizardDialog.createContents(WizardDialog.java:610)
    at org.eclipse.jface.window.Window.create(Window.java:431)
    at org.eclipse.jface.dialogs.Dialog.create(Dialog.java:1089)
    at org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation$1.run(RefactoringWizardOpenOperation.java:178)
    at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
    at org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation.run(RefactoringWizardOpenOperation.java:202)
    at org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation.run(RefactoringWizardOpenOperation.java:122)
    at com.android.ide.eclipse.adt.internal.refactorings.renamepackage.RenamePackageAction.initiateAndroidPackageRefactoring(RenamePackageAction.java:168)
    at com.android.ide.eclipse.adt.internal.refactorings.renamepackage.RenamePackageAction.promptNewName(RenamePackageAction.java:151)
    at com.android.ide.eclipse.adt.internal.refactorings.renamepackage.RenamePackageAction.run(RenamePackageAction.java:106)
    at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:251)
    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:1276)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3554)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3179)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1029)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:923)
    at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:86)
    at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:588)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:543)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
    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:353)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:616)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1438)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1414)
Caused by: java.lang.NullPointerException
    at com.android.ide.eclipse.adt.internal.refactorings.renamepackage.ApplicationPackageNameRefactoring$JavaFileVisitor.visit(ApplicationPackageNameRefactoring.java:423)
    at org.eclipse.core.internal.resources.Resource$2.visit(Resource.java:126)
    at org.eclipse.core.internal.resources.Resource$1.visitElement(Resource.java:85)
    at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:82)
    at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:86)
    at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:86)
    at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:86)
    at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:86)
    at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:86)
    at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:86)
    at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:86)
    at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:86)
    at org.eclipse.core.internal.watson.ElementTreeIterator.iterate(ElementTreeIterator.java:127)
    at org.eclipse.core.internal.resources.Resource.accept(Resource.java:95)
    at org.eclipse.core.internal.resources.Resource.accept(Resource.java:52)
    at org.eclipse.core.internal.resources.Resource.accept(Resource.java:124)
    at org.eclipse.core.internal.resources.Resource.accept(Resource.java:108)
    at com.android.ide.eclipse.adt.internal.refactorings.renamepackage.ApplicationPackageNameRefactoring.createChange(ApplicationPackageNameRefactoring.java:123)
    at org.eclipse.ltk.core.refactoring.CreateChangeOperation.run(CreateChangeOperation.java:124)
    at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344)
    at org.eclipse.ltk.internal.ui.refactoring.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:87)
    at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)

会话数据:

eclipse.buildId=M20120914-1800
java.version=1.6.0_24
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Framework arguments:  -product org.eclipse.epp.package.java.product
Command-line arguments:  -os linux -ws gtk -arch x86_64 -product org.eclipse.epp.package.java.product

我对 Android 很陌生,我不知道从哪里开始。似乎是一个非常相似的问题,但我无法弄清楚user756905建议应该尝试什么......

欢迎提出任何建议,特别是如果在我尝试重新安装 Eclipse 之前有什么可以尝试的。

4

1 回答 1

0

问题是对于您的某些类,它无法对包进行重命名。尝试在项目中搜索以检查您是否有某个没有包的类或是否已注释。

于 2014-11-19T12:10:33.880 回答