5

I get the following error when I run the following code coverage test using ant:

ant emma debug install test

I am running this from an Ubuntu 12.10 terminal. The JUnit4 library was properly added into my eclipse test project. The test project is a simple Android test project. I don't understand why I get the "didn't find class org.junit.test on path..." do I need to add specify more, so that the build knows to also package junit in the resulting test APK?

    -post-build:

debug:

install:
     [echo] Installing /home/jes/IDTest/bin/StartupActivityTest-debug.apk onto default emulator or device...
     [exec] 1017 KB/s (37974 bytes in 0.036s)
     [exec]     pkg: /data/local/tmp/StartupActivityTest-debug.apk
     [exec] Success

-set-mode-check:

-set-instrumented-mode:

install:
     [echo] Installing /home/jes/android/bin/StartupActivity-instrumented.apk onto default emulator or device...
     [exec] 1171 KB/s (9168346 bytes in 7.642s)
     [exec]     pkg: /data/local/tmp/StartupActivity-instrumented.apk
     [exec] Success

installi:

-check-env:
 [checkenv] Android SDK Tools Revision 21.1.0
 [checkenv] Installed at /home/jes/Development/sdk

-setup:
     [echo] Project Name: StartupActivityTest
  [gettype] Project Type: Test Application

-test-project-check:

test:
[getlibpath] Library dependencies:
[getlibpath] 
[getlibpath] ------------------
[getlibpath] Ordered libraries:
     [echo] Running tests...
     [echo] Running tests ...
     [exec] INSTRUMENTATION_RESULT: shortMsg=java.lang.ClassNotFoundException
     [exec] INSTRUMENTATION_RESULT: longMsg=java.lang.ClassNotFoundException: Didn't find class "org.junit.Test" on path: /system/framework/android.test.runner.jar:/data/app/test-1.apk:/data/app/ocr-2.apk
     [exec] INSTRUMENTATION_CODE: 0
     [echo] Setting permission to download the coverage file...
     [exec] Unable to chmod /data/data/ocr/coverage.ec: No such file or directory
     [echo] Downloading coverage file into project directory...
     [exec] remote object '/data/data/ocr/coverage.ec' does not exist

BUILD FAILED
/home/jes/Development/sdk/tools/ant/build.xml:1284: exec returned: 1
Jes Chergui
  • 1,318
  • 1
  • 22
  • 33
  • Have you tried to unpack the .apk files and see if JUnit is inside any of them? I would guess it should only be inside your test project, where you're using JUnit. It shouldn't need to be inside your application's apk. – visola Apr 30 '14 at 16:51

0 Answers0