After the upgrade to the Gradle 3.0.1 version, Jacoco plugin generates redundant jacoco.exec file

I have the following modules:

  • app (com.android.application)
  • testlibrary (com.android.library)

After upgrade of Gradle to the version 3.0.1, Jacoco plugin generates redundant and not valid jacoco.exec file in the app (com.android.application) module’s root folder after execution of tests. This file is generated when in testlibrary (com.android.library) module I set testCoverageEnabled true. If I set in testlibrary testCoverageEnabled false, then jacoco.exec file is not generated.

Expected Behavior
jacoco.exec file shouldn’t be generated in the root folder of app module after execution of tests, regardless testCoverageEnabled flag set to true or false in the testlibrary module.

Current Behavior
After execution of tests, jacoco.exec file is created in the root folder of the app module if in the testlibrary module the testCoverageEnabled flag set to true.

Context
I’m trying to upgrade to the Gradle 3.0.1 version from the Gradle 2.2.2 version. But after upgrade and execution of all tests, I noticed that a new redundant jacoco.exec file was generated inside of app’s root directory.

Steps to Reproduce (for bugs)
GitHub repo to showcase the issue: https://github.com/DenysShovhenia/Test
Steps to reproduce:

  • Open project in Android Studio
  • Run testDebugUnitTest task of Test(root) module
  • Note the newly created jacoco.exec file in the root folder of app module

I hope somebody can help me to resolve this issue.

Also, I have found the same open bug here: https://issuetracker.google.com/issues/67872367