Jacoco code coverage was working fine till I upgrade Android Gradle Plugin to 4.2.0 , no only app module code coverage getting generated, for modules it is not working. Any Idea how to fix this issue.
Upgrade to AGP 4.2.0 ,unable to generate Jacoco code coverage report
1.9k Views Asked by Dev Soni At
2
There are 2 best solutions below
0
MatPag
On
Based on amazing Richard answer, if you previously had this setup (which is pretty standard for unit and instrumented tests with Jacoco in Android)
executionData.from = fileTree(dir: project.buildDir, includes: [
"jacoco/${testTaskName}.exec",
"outputs/code_coverage/${variantName}AndroidTest/connected/**/*.ec"
])
You can switch to this equivalent for AGP 4.2.X
executionData.from = files([
"$project.projectDir/jacoco.exec",
fileTree(dir: project.buildDir, includes: [
"outputs/code_coverage/${variantName}AndroidTest/connected/**/*.ec"
])
])
Related Questions in ANDROID
- Delay in loading Html Page(WebView) from assets folder in real android device
- MPAndroidChart method setWordWrapEnabled() not found
- Designing a 'new post' android activity
- Android :EditText inside ListView always update first item in the listview
- Android: Transferring Data via ContentIntent
- Wrong xml being inflated android
- AsyncTask Class
- Unable to receive extras in Android Intent
- Website zoomed out on Android default browser
- Square FloatingActionButton with Android Design Library
- Google Maps API Re-size
- Push toolbar content below statusbar
- Android FragmentPagerAdapter Circular listview
- Layout not shifting up when keyboard is open
- auDIO_OUTPUT_FLAG_FAST denied by client can't connect to localhost
Related Questions in ANDROID-GRADLE-PLUGIN
- Gradle Duplicate Entry
- How to Install Google Play Services GMS SDK on CircleCI
- android studio upgrade to 1.2.1.1 results in "local path doesnt exist" error
- I gained this error in my gradle and i don't seem to understand what's happening. My gradle file is printed below
- Error in building project in Android Studio
- Code Path per Flavor in Android Gradle
- What does the "Test Artifact" selector do in Android STudio
- java.lang.NoClassDefFoundError on android studio
- Android: Managing different server URL for development and release
- Android NDK - multlib support using gradle
- How to specify dependencies in aar library?
- Android Crashlytics ndk; values of NdkOut and NdkLibsOut in build.gradle
- Android: Couldn't load mupdf
- Aidl is missing error
- Gradle Build Failure
Related Questions in JACOCO
- Using JaCoCo with Liberty Profile 8.5.5.4 in Eclipse does not produce any code coverage
- Exclude classes of jar files from jacoco coverage report
- How to check code coverage with JaCoCo agent?
- Getting jacoco report from cucumber tests with gradle
- Gradle SonarQube Plugin Analysis fails at the very end with MySQLNonTransientConnectionException
- How could I get code coverage for individual tests in Java
- Gradle & Jacoco: Get jacoco reports for Test-type task other than "test"
- Android Gradle Jacoco: offline instrumentation for integration tests
- FileNotFound Jacoco / Gradle
- Execute a task in gradle just before Test Executor ends
- Integrating JaCoCo with Sonar for integration test coverage in Android
- Jacoco Integration test report is not correct
- Jacoco - ignore MyClass.1
- How to generate Jacoco integration test report using offline instrumentation?
- jacoco offline instrumentation original class path
Related Questions in GRADLE-KOTLIN-DSL
- Gradle kotlin script, > Plugin with id `kotlin` not found
- How to get ext.* variables into plugins block in build.gradle.kts
- Accessing source sets with kotlin-dsl for gradle
- Using Gradle to build a jar with dependencies with Kotlin-DSL
- What would a basic Gradle script Kotlin file for a Kotlin JS project look like?
- Unable to publish jar to Gitlab package registry with gradle
- I can't deploy to artifactory Google Cloud
- Gradle test fixtures plugin and core module dependencies
- How to convert testOptions.unitTests.all to gradle Kotlin dsl
- git.exe is not found by gradle
- Error on bundleReleaseAar with gradle 6.5
- How to centralize Gradle build settings?
- How to publish a binary generated by OpenAPI Generator with gradle/kotlin?
- Unable to make progress running work - Android Studio
- How to resolve the Gradle Build Error: java.lang.NoSuchMethodError
Related Questions in JACOCO-PLUGIN
- How to Configure Jacoco code coverage report into Java Play framwork project?
- Cannot set the value of read-only property 'executionData' for task ':addressallocation:jacocoTestDebugUnitTestReport'
- Can test written on PyTest calculate the code coverage using Jacoco of Java code?
- How to ensure jacoco's -javaagent comes before other javaagents on the command line (e.g. spring + aspectj)...?
- How to gather Jacoco coverage information in xml file?
- Jacoco report 0% coverage on apache project run on intellij
- How To Get Code Coverage for only specific classes in Gradle project using Jacoco
- Upgrade to AGP 4.2.0 ,unable to generate Jacoco code coverage report
- Generate Jacoco report for integration tests
- How do I get a Jacoco coverage report using gradle plugin when all my tests are in a separate submodule
- Custom JaCoCo Gradle Plugin - exclude files in report
- using JaCoCo maven plugin in IntelliJ IDEA
- Merge coverage unit and integration test result generated with jacoco-report-aggregation plugin on gradle 7.4
- How to run JaCoCo in other Android Studio sub modules?
- Caused by groovy.lang.MissingPropertyException Could not get unknown property 'android' for project ':lib1' of type org.gradle.api.Project
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
I was having the same problem after upgrading to 4.2.1.
It looks like the Jacoco execution data file for non-instrumented unit tests has been renamed to 'jacoco.exec', and moved to the module's top-level directory.
In the configuration of my JacocoReport gradle task, this works for me:
NOTE: The execution data file for instrumented tests has not been renamed or moved.