2

Yesterday, New Relic started giving NoClassDefFoundErrors to Android projects that didn't have New Relic installed that were located in the same workspace as projects that did have New Relic installed. I found the following post which suggested upgrading to the most recent version, which I did(that problem still persisted though): NoClassDefFoundError on apps that doesn't have newrelic installed

After that upgrade, the project that had New Relic installed started failing in the building stage with the following error output:

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

I attempted removing the New Relic jar from the build path and from the project entirely, but the error still persists. Has anybody encountered a solution?

Community
  • 1
  • 1
Brent Hronik
  • 2,357
  • 1
  • 27
  • 43
  • 2
    This was identified as a (very bad) issue with New Relic's Eclipse plugin, but a fix was released a month or two ago, could you check your version of the New Relic plugin, or even just confirm how recently you installed the Eclipse plugin. – Nočnica Mar 04 '14 at 16:11
  • 1
    We're working through this in our private ticketing system, but I'll post here if and when I get a response. – Nočnica Mar 08 '14 at 01:46
  • 1
    I've experienced this issue today. Removing New Relic from the project fixed it. Is there any fix for this yet? –  Mar 20 '14 at 21:52
  • I am at version 3.330.0, and I have tried removing it from the project, but unfortunately, I still see it. – Brent Hronik Apr 06 '14 at 00:41

2 Answers2

7

First, update New Relic via "Check for Updates" under the Help menu, and then you need to make sure you Update New Relic in your project by clicking on the project and selecting Update. This worked for me.

  • This worked for me too. But can you shed some light on why this happens? Does newrelic deliberately throw a null pointer exception so that we update it? – amalBit Jan 28 '15 at 14:00
0

It looks like it was my Eclipse Workspace itself that got fried. Removing and updating New Relic didn't fix the issue, but creating an entire new Workspace and then importing the code into that fixed it.

Brent Hronik
  • 2,357
  • 1
  • 27
  • 43