# Build Cache misbehaving with the Android Plugin

**URL:** https://discuss.gradle.org/t/build-cache-misbehaving-with-the-android-plugin/28183
**Category:** Help/Discuss
**Tags:** performance
**Created:** [August 15, 2018, 7:12pm UTC](https://discuss.gradle.org/t/build-cache-misbehaving-with-the-android-plugin/28183 "2018-08-15T19:12:52Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![vkryachko](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/vkryachko/32/7136_2.png) [@vkryachko](https://discuss.gradle.org/u/vkryachko)
#### Post date: [August 15, 2018, 7:12pm UTC](https://discuss.gradle.org/t/build-cache-misbehaving-with-the-android-plugin/28183/1 "2018-08-15T19:12:52Z")

</div>

According to [Build Cache](https://docs.gradle.org/current/userguide/build_cache.html#sec:task_output_caching_cacheable_3rd_party) documentation, the android plugin is supported and work well with it.

But enabling build cache e.g. with the --build-cache flag does not work as expected, namely test and connectedTest tasks are always executed and are never taken FROM-CACHE. Is this a known issue or am I missing something?

**Steps to reproduce:**

1. create a new project in Android Studio ( created a gradle project with gradle=4.4, android-plugin=3.1.3)
2. ./gradlew --build-cache :app:test
3. ./gradlew clean
4. ./gradlew --build-cache :app:test

**The following tasks will not be taken from cache:**  
:app:checkDebugManifest  
:app:mainApkListPersistenceDebug  
:app:testDebugUnitTest  
:app:checkReleaseManifest  
:app:mainApkListPersistenceRelease  
:app:testReleaseUnitTest  
:app:test

Any ideas?

Thanks
