gpt4 book ai didi

android - 重命名 Android 包名称失败

转载 作者:塔克拉玛干 更新时间:2023-11-01 21:59:05 27 4
gpt4 key购买 nike

我在 eclipse 中右键单击我的项目,android 工具,“重命名应用程序包”。

选择任何名称,它将失败,并将您定向到错误日志以获取详细信息。

我发现了以下内容:

eclipse.buildId=M20110210-1200
java.version=1.6.0_26
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=nl_BE
Framework arguments: -product org.eclipse.epp.package.java.product
Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product

错误2011 年 6 月 24 日星期五 10:11:31 CEST内部错误

java.lang.reflect.InvocationTargetException
at org.eclipse.ltk.internal.ui.refactoring.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:91)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
Caused by: org.eclipse.core.internal.resources.ResourceException: An error occurred while traversing resources.
at org.eclipse.core.internal.resources.Resource.accept(Resource.java:83)
at org.eclipse.core.internal.resources.Resource.accept(Resource.java:110)
at org.eclipse.core.internal.resources.Resource.accept(Resource.java:94)
at com.android.ide.eclipse.adt.internal.refactorings.renamepackage.ApplicationPackageNameRefactoring.createChange(ApplicationPackageNameRefactoring.java:128)
at org.eclipse.ltk.core.refactoring.CreateChangeOperation.run(CreateChangeOperation.java:124)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1975)
at org.eclipse.ltk.internal.ui.refactoring.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:87)
... 1 more
Caused by: java.lang.NullPointerException
at com.android.ide.eclipse.adt.internal.refactorings.renamepackage.ApplicationPackageNameRefactoring.updateJavaFileImports(ApplicationPackageNameRefactoring.java:151)
at com.android.ide.eclipse.adt.internal.refactorings.renamepackage.ApplicationPackageNameRefactoring$JavaFileVisitor.visit(ApplicationPackageNameRefactoring.java:427)
at org.eclipse.core.internal.resources.Resource$2.visit(Resource.java:112)
at org.eclipse.core.internal.resources.Resource$1.visitElement(Resource.java:64)
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.iterate(ElementTreeIterator.java:127)
at org.eclipse.core.internal.resources.Resource.accept(Resource.java:74)
... 7 more
Root exception:
org.eclipse.core.internal.resources.ResourceException(/Touring Mobilis)[566]: java.lang.NullPointerException
at com.android.ide.eclipse.adt.internal.refactorings.renamepackage.ApplicationPackageNameRefactoring.updateJavaFileImports(ApplicationPackageNameRefactoring.java:151)
at com.android.ide.eclipse.adt.internal.refactorings.renamepackage.ApplicationPackageNameRefactoring$JavaFileVisitor.visit(ApplicationPackageNameRefactoring.java:427)
at org.eclipse.core.internal.resources.Resource$2.visit(Resource.java:112)
at org.eclipse.core.internal.resources.Resource$1.visitElement(Resource.java:64)
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.iterate(ElementTreeIterator.java:127)
at org.eclipse.core.internal.resources.Resource.accept(Resource.java:74)
at org.eclipse.core.internal.resources.Resource.accept(Resource.java:110)
at org.eclipse.core.internal.resources.Resource.accept(Resource.java:94)
at com.android.ide.eclipse.adt.internal.refactorings.renamepackage.ApplicationPackageNameRefactoring.createChange(ApplicationPackageNameRefactoring.java:128)
at org.eclipse.ltk.core.refactoring.CreateChangeOperation.run(CreateChangeOperation.java:124)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1975)
at org.eclipse.ltk.internal.ui.refactoring.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:87)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)

这个工具对任何人都有效吗?如果是这样,请告诉我您使用的是什么版本的 Eclipse。

我在 Windows 7 上使用最新版本的 eclipse(64 位)和最新的 ADT eclipse 插件。

最佳答案

你无法相信这一点。我有完全相同的问题,是因为我完全评论了一个类(class)。所以我认为当 Eclipse 尝试更改注释类的包名称时,它会抛出此错误。

要解决该问题,您只需删除类或取消注释即可。

关于android - 重命名 Android 包名称失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6465127/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com