# Unable to Exclude packages out of code coverage in android and jacoco

**URL:** <https://discuss.gradle.org/t/unable-to-exclude-packages-out-of-code-coverage-in-android-and-jacoco/21610>\
**Category:** Help/Discuss\
**Tags:** plugins\
**Created:** [February 16, 2017, 10:43am UTC](https://discuss.gradle.org/t/unable-to-exclude-packages-out-of-code-coverage-in-android-and-jacoco/21610 "2017-02-16T10:43:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![puvsprasad](https://avatars.discourse-cdn.com/v4/letter/p/ccd318/32.png) [@puvsprasad](https://discuss.gradle.org/u/puvsprasad)\
**Post date:** [February 16, 2017, 10:43am UTC](https://discuss.gradle.org/t/unable-to-exclude-packages-out-of-code-coverage-in-android-and-jacoco/21610/1 "2017-02-16T10:43:36Z")

</div>

Hi,

Am Unable to exclude some packages out of code coverage through build.gradle in android.  
Tried to exclude the files in below way, but did’t worked out.

sourceSets{  
test {  
java{  
exclude ‘ **/UI/** ’  
}  
}  
}  
With the above code snippet, all my test 77 test cases are vanished, none of them considered and shown as 0% code coverage.

Also tried, exclude ‘\*\*/RegistartionActivityTest.java’, but it still shows the coverage of this particular file.

Please help me in this regard,as i’ve stuck up.

Thanks and Regards,  
Satya Prasad.

---

<div class="post-metadata">

**Author:** ![radityagumay](https://avatars.discourse-cdn.com/v4/letter/r/b77776/32.png) [@radityagumay](https://discuss.gradle.org/u/radityagumay)\
**Post date:** [April 7, 2018, 4:57am UTC](https://discuss.gradle.org/t/unable-to-exclude-packages-out-of-code-coverage-in-android-and-jacoco/21610/2 "2018-04-07T04:57:01Z")

</div>

@puvsprasad hi did you solve this issue?
