NoClassDefFoundError when running Instrumentation test with ant

醉酒当歌 提交于 2019-11-29 13:42:32

Since this post was the first in search engine results when I entered "java.lang.NoClassDefFoundError: com.flurry.android.FlurryAgent" and my issue was not related to Ant at all, I thought I'd add some info for people who might be scratching their heads after re-installing the ADT.

Basically, in Eclipse when you add an external library in the Java Build Path dialog, don't forget to also switch to the Order and Export tab and tick that library's name in the list. This is needed so that the library is found at run-time, not only at compile time :)

http://code.google.com/p/android/issues/detail?id=27608

I submitted the issue to Google and they uploaded a temporary fix. The fix will also be included in v18 release.

"project member x...@android.com, Today (34 minutes ago) get the anttasks.jar from the bottom of http://tools.android.com/download to replace the one in your sdk."

The file to replace is at \Android\android-sdk\tools\lib\

It took me a very long time to figure this same problem out when using android-junit-report, but with the help of "adb logcat" I discovered that it wasn't actually missing the instrumentation class that I included, but it was missing its inherited superclass. So I needed to put this back into AndroidManifest.xml:

<application>
    <uses-library android:name="android.test.runner" />
</application>
Bill

I dont have the rep to comment Qi but I think this may be related to my question here:

VerifyError in android test-project build tools v17

Xav has been instrumental in getting this back up and running and looks like hes got a fix

I have the same case and it doesn't work even if I followed Levon's post. Then I realized I need to copy the FlurryAnalytics.jar into the libs folder in my work space to make it work. Hope this helps.

I have just fix this problem "08-14 08:33:43.398: E/AndroidRuntime(6748): java.lang.NoClassDefFoundError: com.flurry.android.FlurryAgent"

I flow the official web when I want to add the flurry to my android app,it tell me add an external library in the Java Build Path dialog, And then I don't forget to also switch to the Order and Export tab and tick that library's name in the list. This is needed so that the library is found at run-time, not only at compile time,But however it do not works until I just remove the jar from build path,and then copy it to the lib. Done!!!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!