java.io.FileNotFoundException when running Jacoco inside an Android Kotlin project

I’m not able to generate code coverage reports using Jacoco plugin inside an Android project, written entirely in Kotlin. Build fails with a java.io.FileNotFoundException on a path containing an $inlined segment. When I navigate into the classes folder I notice that the path actually has the $$inlined segment, with double dollar sign.

Link to the issue opened in the Jacoco project on GitHub: https://github.com/jacoco/jacoco/issues/433

Jacoco Plugin Version: 0.7.7.201606060606
Gradle Version: 2.14.1
Operating System: OSX 10.11.6
Is this a regression? If yes, which version of Gradle do you know it last worked for? Most likely not, observed same issue using Gradle 2.10.

Example project: https://github.com/Egorand/jacoco-kotlin-issue
Build scan: https://scans.gradle.com/s/hhsqymgsgzmz4

Thank you for your report! With your project I could easily reproduce the problem. I opened GRADLE-3511 to track the bug and fixed the bug on the 3.0 release branch. This means a fix for this problem should be included in 3.0-rc-1.

Hi Stefan_Wolf,

Thanks for fixing this! Looking forward to the release.

Thanks Stefan,

I can confirm that this issue is fixed at least with gradle 3.1 and com.android.tools.build:gradle:2.2.0. I verified it also against Egors example project.