意外的顶级异常:处理com / newrelic / agent / android / Agent.class时的com.android.dx.util.ExceptionWithContext

时间:2014-03-02 01:10:17

标签: android newrelic

昨天,New Relic开始向没有安装New Relic的Android项目提供NoClassDefFoundErrors,这些项目与安装了New Relic的项目位于同一个工作区。我发现以下帖子建议升级到最新版本,我做了(虽然问题仍然存在):NoClassDefFoundError on apps that doesn't have newrelic installed

在升级之后,安装了New Relic的项目在构建阶段开始失败并出现以下错误输出:

UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dx.util.ExceptionWithContext [2014-03-01 17:57:48 -
BumpyCard] Dx   at
com.android.dx.util.ExceptionWithContext.withContext(ExceptionWithContext.java:46)
[2014-03-01 17:57:48 - BumpyCard] Dx    at
com.android.dx.dex.cf.CfTranslator.translate(CfTranslator.java:90)
[2014-03-01 17:57:48 - BumpyCard] Dx    at
com.android.dx.command.dexer.Main.processClass(Main.java:487)
[2014-03-01 17:57:48 - BumpyCard] Dx    at
com.android.dx.command.dexer.Main.processFileBytes(Main.java:459)
[2014-03-01 17:57:48 - BumpyCard] Dx    at
com.android.dx.command.dexer.Main.access$400(Main.java:67) [2014-03-01
17:57:48 - BumpyCard] Dx    at
com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:398)
[2014-03-01 17:57:48 - BumpyCard] Dx    at
com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:245)
[2014-03-01 17:57:48 - BumpyCard] Dx    at
com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:131)
[2014-03-01 17:57:48 - BumpyCard] Dx    at
com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:109)
[2014-03-01 17:57:48 - BumpyCard] Dx    at
com.android.dx.command.dexer.Main.processOne(Main.java:422)
[2014-03-01 17:57:48 - BumpyCard] Dx    at
com.android.dx.command.dexer.Main.processAllFiles(Main.java:333)
[2014-03-01 17:57:48 - BumpyCard] Dx    at
com.android.dx.command.dexer.Main.run(Main.java:209) [2014-03-01
17:57:48 - BumpyCard] Dx    at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[2014-03-01 17:57:48 - BumpyCard] Dx    at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[2014-03-01 17:57:48 - BumpyCard] Dx    at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[2014-03-01 17:57:48 - BumpyCard] Dx    at
java.lang.reflect.Method.invoke(Method.java:597) [2014-03-01 17:57:48
- BumpyCard] Dx     at com.android.ide.eclipse.adt.internal.build.DexWrapper.run(DexWrapper.java:187)
[2014-03-01 17:57:48 - BumpyCard] Dx    at
com.android.ide.eclipse.adt.internal.build.BuildHelper.executeDx(BuildHelper.java:753)
[2014-03-01 17:57:48 - BumpyCard] Dx    at
com.android.ide.eclipse.adt.internal.build.builders.PostCompilerBuilder.build(PostCompilerBuilder.java:593)
[2014-03-01 17:57:48 - BumpyCard] Dx    at
org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:726)
[2014-03-01 17:57:48 - BumpyCard] Dx    at
org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
[2014-03-01 17:57:48 - BumpyCard] Dx    at
org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:199)
[2014-03-01 17:57:48 - BumpyCard] Dx    at
org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:321)
[2014-03-01 17:57:48 - BumpyCard] Dx    at
org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:396)
[2014-03-01 17:57:48 - BumpyCard] Dx    at
org.eclipse.core.internal.resources.Project$1.run(Project.java:618)
[2014-03-01 17:57:48 - BumpyCard] Dx    at
org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344)
[2014-03-01 17:57:48 - BumpyCard] Dx    at
org.eclipse.core.internal.resources.Project.internalBuild(Project.java:597)
[2014-03-01 17:57:48 - BumpyCard] Dx    at
org.eclipse.core.internal.resources.Project.build(Project.java:124)
[2014-03-01 17:57:48 - BumpyCard] Dx    at
com.android.ide.eclipse.adt.internal.project.ProjectHelper.doFullIncrementalDebugBuild(ProjectHelper.java:1059)
[2014-03-01 17:57:48 - BumpyCard] Dx    at
com.android.ide.eclipse.adt.internal.launch.LaunchConfigDelegate.launch(LaunchConfigDelegate.java:147)
[2014-03-01 17:57:48 - BumpyCard] Dx    at
org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:855)
[2014-03-01 17:57:48 - BumpyCard] Dx    at
org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:704)
[2014-03-01 17:57:48 - BumpyCard] Dx    at
org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:1047)
[2014-03-01 17:57:48 - BumpyCard] Dx    at
org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1251)
[2014-03-01 17:57:48 - BumpyCard] Dx    at
org.eclipse.core.internal.jobs.Worker.run(Worker.java:53) [2014-03-01
17:57:48 - BumpyCard] Dx Caused by: java.lang.NullPointerException
[2014-03-01 17:57:48 - BumpyCard] Dx    at
com.android.dx.util.ByteArray.<init>(ByteArray.java:76) [2014-03-01
17:57:48 - BumpyCard] Dx    at
com.android.dx.cf.direct.DirectClassFile.<init>(DirectClassFile.java:205)
[2014-03-01 17:57:48 - BumpyCard] Dx    at
com.android.dx.dex.cf.CfTranslator.translate0(CfTranslator.java:108)
[2014-03-01 17:57:48 - BumpyCard] Dx    at
com.android.dx.dex.cf.CfTranslator.translate(CfTranslator.java:87)
[2014-03-01 17:57:48 - BumpyCard] Dx    ... 33 more ...while processing
com/newrelic/agent/android/Agent.class

[2014-03-01 17:57:48 - BumpyCard] Dx 1 error; aborting [2014-03-01
17:57:48 - BumpyCard] Conversion to Dalvik format failed with error 1

我尝试从构建路径和项目中完全删除New Relic jar,但错误仍然存​​在。有没有人遇到过解决方案?

2 个答案:

答案 0 :(得分:7)

首先,通过“帮助”菜单下的“检查更新”更新New Relic,然后您需要通过单击项目并选择“更新”来确保在项目中更新New Relic。这对我有用。

答案 1 :(得分:0)

看起来我的Eclipse Workspace本身就被炒了。删除和更新New Relic并没有解决问题,而是创建了一个全新的Workspace,然后将代码导入到修复它的代码中。