title: Code Coverage on Android
body: <p>I know that there are many questions that have been asked about Android code coverage (I have done some researches before asking here), yet I still get stuck at some points so if you can help, I will appreciate it very much.
  What I am doing right now is not really Unit Test but Activity Test to verify the views (check whether they're null or not, check the buttons if they're clickable, counts the number of view in one activity), then I implement some code to test public methods of each activity too and I want to know the code coverage of those tests. First I try EclEmma but it seems like they don't support android so I move to Emma. Then I have a common error as many many people on the Internet: </p>
  
  <pre><code> [exec] android.test.suitebuilder.TestSuiteBuilder$FailedToCreateTests:INSTRUMENTATION_RESULT: shortMsg=java.lang.IllegalAccessError
   [exec] INSTRUMENTATION_RESULT: longMsg=java.lang.IllegalAccessError: Classref in pre-verified class resolved to unexpected implementation
  [exec] INSTRUMENTATION_CODE: 0
  [echo] Setting permission to download the coverage file...
  [exec] Unable to chmod /data/coverage.ec: No such file or directory
  [echo] Downloading coverage file into project directory...
  [exec] remote object '/data/coverage.ec' does not exist
  </code></pre>
  
  <p>I tried many things that other people do but they just can't fix my issues. I changed from data/data/coverage.ec to sdcard/coverage.ec and now is data/coverage.ec, none of them works. I tried to mount -o remount rw /sdcard, that doesn't work too.</p>
  
  <p>Is there any other ways to fix this? Are Activity Tests even test-able? or I have to change to something other than Emma?</p>