title: Jacoco: For report generation the same class files must be used as at runtime
body: <p>I have been working on an android project and use roboletric and powermock to do unitTests.</p>
  <p>When I run <code>gradle jacocoTestReport</code>, it will show</p>
  <pre><code>[ant:jacocoReport] Classes in bundle 'app' do no match with execution data. For report generation the same class files must be used as at runtime.
  [ant:jacocoReport] Execution data for class com/my/app/MyClass does not match.
  </code></pre>
  <p>Where I use powermock to mock the static method in Myclass.java</p>
  <pre><code>@RunWith(RobolectricGradleTestRunner.class)
  @Config(constants = BuildConfig.class, sdk = 21)
  @PowerMockIgnore({ &quot;org.mockito.*&quot;, &quot;org.robolectric.*&quot;, &quot;android.*&quot; })
  @PrepareForTest(MyClass.class)
  public class TheTest {
  
      @Rule
      public PowerMockRule rule = new PowerMockRule();
  
      @Test
      public void test1() throws Exception {
          PowerMockito.mockStatic(MyClass.class);
          // do something
      }
  }
  </code></pre>
  <p>And the build.gradle is shown as follows</p>
  <pre><code>apply plugin: 'jacoco'
  def coverageSourceDirs = [
           '../app/src/main/java'
  ]
  
  task jacocoTestReport(type:JacocoReport, dependsOn: &quot;testDebugUnitTest&quot;) {
      group = &quot;Reporting&quot;
      description = &quot;Generate Jacoco coverage reports&quot;
  
      classDirectories = fileTree(
              dir: '../app/build/intermediates/classes/debug',
              excludes: ['**/R.class',
                         '**/R$*.class',
                         '**/*$ViewInjector*.*',
                         '**/BuildConfig.*',
                         '**/Manifest*.*']
      )
  
      additionalSourceDirs = files(coverageSourceDirs)
      sourceDirectories = files(coverageSourceDirs)
      executionData = files('../app/build/jacoco/testDebugUnitTest.exec')
  
      reports {
          xml.enabled = true
          html.enabled = true
      }
  
  }
  </code></pre>
  <p>I can still see the coverage report without distortion.</p>
  <p>But How to get rid of such warning?</p>