NoClassDefFoundError when running Instrumentation test with ant

后端 未结 6 959
忘掉有多难
忘掉有多难 2020-12-20 18:07

(This is an Android SDK tools v17 problem. Expect a fix in v18)

I have a test target project A, and a tester project B.

Project A has FlurryAgent.jar in it

相关标签:
6条回答
  • 2020-12-20 18:16

    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

    0 讨论(0)
  • 2020-12-20 18:20

    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\

    0 讨论(0)
  • 2020-12-20 18:20

    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>
    
    0 讨论(0)
  • 2020-12-20 18:24

    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 :)

    0 讨论(0)
  • 2020-12-20 18:35

    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.

    0 讨论(0)
  • 2020-12-20 18:39

    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!!!

    0 讨论(0)
提交回复
热议问题