-->

NoClassDefFoundError on apps that doesn't have

2019-04-21 09:07发布

问题:

I've installed newrelic for my android app using their guide for eclipse.

It is working ok on that app.

Now, if I create a simple hello world project i'm receiving a NoClassDefFoundError.

How can I solve this?

Thank you in advance.

I've already searched in all NewRelics Documentation and submited a ticket to them.

News From New Relic's team There are several users having the same issue.

There is not a way to reproduce the problem and there is not ETA yet.

回答1:

New Relic was finally able to reproduce this issue and has fixed it as of version 2.444.0 and 3.199.0 (if you're running the beta version). To upgrade, just click Eclipse's "Check for updates" menu option. If you're still having the issue, please reach out to support@newrelic.com.



回答2:

After reading and investigating into the matter here and all over the net it seems alot of people ran into this problem...
(which annoyed the hell out of me & wasted precious dev time),

This worked for me:

FIRST

In Eclipse, go to the Project properties -> Java Build Path.
Select the Order and Export Tab and Uncheck your third party jars.

NEXT

Other projects where I followed the same fix pattern, I got an error:

09-21 12:58:51.122: E/AndroidRuntime(27033): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.ndroidians.listfrag/com.ndroidians.listfrag.MainActivity}: java.lang.ClassNotFoundException: com.ndroidians.listfrag.MainActivity

After reading a few posts here I just went to manifest and reselected the activity in the GUI: AndroidManifest.xml -> Application tab -> Application Nodes -> MainActivity -> (Right hand side parameters) Name -> Browse -> Choose you activity again

That fixed other projects problems with newrelic.

newrelic people: maybe you should consider more then twice before releasing a component that meddles with android API, and causes alot of people anguish and time waist!!!

I have submitted several tickets since first installation of your component BUT I guess - in vain!



回答3:

One possible solution: you may not be seeing the 'libs' directory appearing in your other applications in Eclipse. To fix this, just refresh the project (it's in the right-click menu) and the 'libs' directory will show.



回答4:

I had the same issue. I solved with right-click menu => Install new relic. Then the application run perfectly



回答5:

This issue is typically seen after upgrading to ADT 22, you may see "java.lang.NoClassDefFoundError" when attempting to run your project. This is because sometimes, when upgrading to ADT 22, the new Android Private Libraries is not checked in the Order and Export of your Java Build Path.

To fix this:

In Eclipse, click your project. Select File > Properties. Click Java Build Path > Order and Export. Check the box for Android Private Libraries, and click OK. Clean your project by selecting Project > Clean.



回答6:

The simple solution is for each project with this error: right-click > Install new relic

Which is not ideal as it forces you to install New Relic in all your projects.

In my experience, there have been several problems with the New Relic Eclipse plugin which caused me to have to re-install Eclipse and the Android SDK and after that I get the "noclassdeffound" error as discussed here.

I'm using Ubuntu 13.10 (Saucy) with OpenJDK 7 running Eclipse Kepler 4.3 and Android SDK v23, all of which 64-bit software running on a brand new AMD FX 3.8ghz quad core machine with 8GB of RAM. Not sure how any of this related to this problem, however it is noteworthy that I was using the Oracle sun-7-jre for Java when New Relic was first installed, but changed it when there was an error saying I need the JDK installed after auto restarting. After doing this Eclipse crashed and would no longer run at all which is what forced me to re-install Eclipse.

Hope this helps someone with the same problem or one of the New Relic guys on here.

Generally I do not like how the New Relic plugin meddles with the Android API also.



回答7:

Step1->In Eclipse Go to Windows|Preferences under Startup/Shutdown disable the NewRelic plugin.

Make sure you restart Eclipse after the step 1 so the plugin unloads from memory



回答8:

Unistalling New Relic from Eclipse Android Project

After removing New Relic sdk I faced the same error! My Admob ads didn't show up because of something New Relic plugin left behing!

I managed to get rid of that problem by using this method :

Project -> Properties -> Java Build Path -> Libraries (Tab)

I removed everything except for the Android (Android 4.4 in my case). Then I manually added the libraries I needed (Admob in my case). Did a clean and then build and thankfully it now works!

Bye Bye New Relic for ever!