I have created a simple android project to demonstrate the issue. After updating gradle-wrapper for the android project, Jacoco does not consider unit tests coverage for android libs.
Current versions:
classpath "org.jacoco:org.jacoco.core:0.8.6"
classpath "com.android.tools.build:gradle:4.1.3"
classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:3.1.1"
Following are the Jacoco Reports for gradle wrapper 6.5.1
Project Report
App Report
Lib Report
Same project reporting 100% code coverage for gradle wrapper 6.3. I don't want to update my wrapper version to 6.3 in my actual project due to technical requirements.
Sample Repo - https://github.com/Gaurav-Sutar/JacocoReport/tree/master