{"id":15044139,"url":"https://github.com/gradle/android-cache-fix-gradle-plugin","last_synced_at":"2025-10-20T04:06:40.290Z","repository":{"id":37396997,"uuid":"109281580","full_name":"gradle/android-cache-fix-gradle-plugin","owner":"gradle","description":"Gradle plugin that fixes Android build caching problems.","archived":false,"fork":false,"pushed_at":"2025-05-09T00:33:48.000Z","size":3120,"stargazers_count":503,"open_issues_count":7,"forks_count":51,"subscribers_count":27,"default_branch":"main","last_synced_at":"2025-05-09T01:29:46.990Z","etag":null,"topics":["android","gradle"],"latest_commit_sha":null,"homepage":"https://plugins.gradle.org/plugin/org.gradle.android.cache-fix","language":"Groovy","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gradle.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-11-02T15:16:25.000Z","updated_at":"2025-05-05T12:47:08.000Z","dependencies_parsed_at":"2024-01-18T00:55:05.661Z","dependency_job_id":"e090e5c5-3667-41a3-a203-95365cf8407e","html_url":"https://github.com/gradle/android-cache-fix-gradle-plugin","commit_stats":{"total_commits":1116,"total_committers":35,"mean_commits":"31.885714285714286","dds":0.8324372759856631,"last_synced_commit":"063093de3b411431e78ff44127b0783a5e48f8a7"},"previous_names":[],"tags_count":89,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gradle%2Fandroid-cache-fix-gradle-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gradle%2Fandroid-cache-fix-gradle-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gradle%2Fandroid-cache-fix-gradle-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gradle%2Fandroid-cache-fix-gradle-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gradle","download_url":"https://codeload.github.com/gradle/android-cache-fix-gradle-plugin/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254346624,"owners_count":22055808,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","gradle"],"created_at":"2024-09-24T20:50:08.021Z","updated_at":"2025-10-20T04:06:40.283Z","avatar_url":"https://github.com/gradle.png","language":"Groovy","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003e _This repository is maintained by the Develocity Solutions team, as one of several publicly available repositories:_\n\u003e - _[Android Cache Fix Gradle Plugin][android-cache-fix-plugin] (this repository)_\n\u003e - _[Common Custom User Data Gradle Plugin][ccud-gradle-plugin]_\n\u003e - _[Common Custom User Data Maven Extension][ccud-maven-extension]_\n\u003e - _[Develocity Build Configuration Samples][develocity-build-config-samples]_\n\u003e - _[Develocity Build Validation Scripts][develocity-build-validation-scripts]_\n\u003e - _[Develocity Open Source Projects][develocity-oss-projects]_\n\u003e - _[Quarkus Build Caching Extension][quarkus-build-caching-extension]_\n\n\n# Android Cache Fix Gradle Plugin\n\n[![Verify Build](https://github.com/gradle/android-cache-fix-gradle-plugin/actions/workflows/build-verification.yml/badge.svg?branch=main)](https://github.com/gradle/android-cache-fix-gradle-plugin/actions/workflows/build-verification.yml)\n[![Plugin Portal](https://img.shields.io/maven-metadata/v?metadataUrl=https://plugins.gradle.org/m2/gradle/plugin/org/gradle/android/android-cache-fix-gradle-plugin/maven-metadata.xml\u0026label=Plugin%20Portal)](https://plugins.gradle.org/plugin/org.gradle.android.cache-fix)\n[![Revved up by Develocity](https://img.shields.io/badge/Revved%20up%20by-Develocity-06A0CE?logo=Gradle\u0026labelColor=02303A)](https://ge.solutions-team.gradle.com/scans)\n\n\nSome Android plugin versions have issues with Gradle's build cache feature. When applied to an Android project this plugin applies workarounds for these issues based on the Android plugin and Gradle versions. For other versions, please see [older versions.](#older-android-gradle-plugin-versions)\n\n* Supported Gradle versions: 7.0+\n* Supported Android Gradle Plugin versions: 7.0+, including alpha, beta, and rc versions\n* Supported Kotlin versions: 1.7.0+\n\nWe only test against the latest patch versions of each minor version of Android Gradle Plugin.  This means that although it may work perfectly well with an older patch version (say 7.0.1), we do not test against these older patch versions, so the latest patch version is the only version from that minor release that we technically support.\n\nThe Android cache fix plugin is compatible with the [Gradle Configuration Cache](https://docs.gradle.org/current/userguide/configuration_cache.html#header) when used in conjunction with Android Gradle Plugin 4.2.0 and above.  Using the configuration cache with earlier versions of the Android Gradle Plugin is not supported.\n\n## Should I use this?\nTake a look at the [list of issues](#list-of-issues) especially [unresolved issues](#unresolved-issues). If any of these apply to your project, you can use this plugin to solve them.\n\n## How can I discover issues?\nYou can discover issues by using the task input comparison tool in Develocity. More information about [how to diagnose cache misses here](https://docs.gradle.com/enterprise/tutorials/task-inputs-comparison/). You can compare the inputs of a build that seeds the build cache - typically CI - with a build that consumes from the build cache like a local developer build.\nIf you discover an issue related to the Android Gradle Plugin, please file an issue in the [Android Bug Tracker](https://source.android.com/setup/contribute/report-bugs). You can also file an [issue here](https://github.com/gradle/android-cache-fix-gradle-plugin/issues) and we can see if a workaround is possible.\n\n## Applying the plugin\n\nThis plugin should be applied anywhere the `com.android.application` or `com.android.library` plugins are applied. We recommend adding the plugin to your project's [conventions plugin](https://docs.gradle.org/current/samples/sample_convention_plugins.html).\n\n\u003cdetails open\u003e\n\u003csummary\u003eKotlin\u003c/summary\u003e\n\u003cbr\u003e\n\n```kotlin\n// in build.grade.kts for convention plugin build\ndependencies {\n  // ...\n  implementation(\"org.gradle.android.cache-fix:org.gradle.android.cache-fix.gradle.plugin:3.0.2\")\n  // ...\n}\n\n// in com.myconventions.build.gradle.kts\nplugins {\n    id(\"com.android.application\") // or \"com.android.library\"\n  // Add this next line to your existing convention plugin.\n    id(\"org.gradle.android.cache-fix\")\n}\n```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eGroovy\u003c/summary\u003e\n\u003cbr\u003e\n\n```groovy\n// in build.grade for convention plugin build\ndependencies {\n    // ...\n    implementation(\"org.gradle.android.cache-fix:org.gradle.android.cache-fix.gradle.plugin:3.0.2\")\n    // ...\n}\n\n// in com.myconventions.build.gradle\nplugins {\n    id 'com.android.application' // or 'com.android.library'\n    // Add this next line to your existing convention plugin.\n    id 'org.gradle.android.cache-fix'\n}\n```\n\n\u003c/details\u003e\n\nIf you are not using convention plugins and would like a quick way of testing the plugin you can alternatively place it in the root project's build.gradle. We discourage this approach because it uses [cross project configuration](https://docs.gradle.org/current/userguide/sharing_build_logic_between_subprojects.html#sec:convention_plugins_vs_cross_configuration).\n\n\u003cdetails open\u003e\n\u003csummary\u003eKotlin\u003c/summary\u003e\n\u003cbr\u003e\n\n```kotlin\nplugins {\n    id(\"org.gradle.android.cache-fix\") version \"3.0.2\" apply false\n}\n\nsubprojects {\n    plugins.withType\u003ccom.android.build.gradle.api.AndroidBasePlugin\u003e() {\n        apply(plugin = \"org.gradle.android.cache-fix\")\n    }\n}\n```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eGroovy\u003c/summary\u003e\n\u003cbr\u003e\n\n```groovy\nplugins {\n    id \"org.gradle.android.cache-fix\" version \"3.0.2\" apply false\n}\n\nsubprojects {\n    plugins.withType(com.android.build.gradle.api.AndroidBasePlugin) {\n        project.apply plugin: \"org.gradle.android.cache-fix\"\n    }\n}\n```\n\u003c/details\u003e\n\n## List of issues\n\nYou can take a look at the list of issues that the plugin fixes by looking at the classes in  [`org.gradle.android.workarounds`](https://github.com/gradle/android-cache-fix-gradle-plugin/blob/master/src/main/groovy/org/gradle/android/workarounds). It contains a number of `Workaround` implementations annotated with `@AndroidIssue`. The Javadoc has a short description of the problem, and the annotation gives information about when the problem was introduced, what is the first version of the Android plugin that fixes it, and there's a link to the issue on Android's issue tracker:\n\n```groovy\n/**\n * Fix {@link org.gradle.api.tasks.compile.CompileOptions#getBootClasspath()} introducing relocatability problems for {@link AndroidJavaCompile}.\n */\n@AndroidIssue(introducedIn = \"3.0.0\", fixedIn = \"3.1.0-alpha06\", link = \"https://issuetracker.google.com/issues/68392933\")\nstatic class AndroidJavaCompile_BootClasspath_Workaround implements Workaround {\n    // ...\n}\n```\n\n### Unresolved Issues\n\n***Please vote for the linked issues if you are experiencing them in your project.***\n\nFixed by the Android Cache Fix plugin, but unresolved in any current or upcoming preview release of the Android Gradle Plugin:\n\nNot fixed by the Android Cache Fix plugin since it has no workaround:\n\n* CompileLibraryResourcesTask outputs contain absolute paths: https://issuetracker.google.com/issues/282761461\n\nNot fixed by the Android Cache Fix plugin since it has no workaround but is fixed in Android Gradle Plugin 8.0.0 or newer:\n\n* MergeResources is not relocatable: https://issuetracker.google.com/issues/246529491\n\n### Room\nThe Room annotation processor causes cache misses: https://issuetracker.google.com/issues/132245929.\nTo work around this issue, please apply the [Room Gradle Plugin](https://developer.android.com/jetpack/androidx/releases/room#gradle-plugin).\n\n\n## Implementation Notes\n\n### MergeNativeLibs, StripDebugSymbols, MergeJavaResources, MergeSourceSetFolders, BundleLibraryClassesJar, DataBindingMergeDependencyArtifacts, LibraryJniLibs and ZipMerging Workarounds\n\nIt has been observed that caching the `MergeNativeLibsTask`, `StripDebugSymbols`, `MergeSourceSetFolders`, `BundleLibraryClassesJar`, `DataBindingMergeDependencyArtifacts`, `LibraryJniLibs` and  `ZipMergingTask` tasks rarely provide any significant positive avoidance savings.  In fact, they frequently provide negative savings, especially when fetched from a remote cache node.  As such, these workarounds disable caching for these tasks.\n\n### Older Android Gradle Plugin Versions\n\nUse Android Cache Fix Plugin 2.4.6 when using an older Android Gradle Plugin version.\n\n* Supported Gradle versions: 5.4.1+\n* Supported Android Gradle Plugin versions: 3.5.4, 3.6.4, 4.0.1, 4.1.3, 4.2.2\n\n### Older Kotlin Gradle Plugin Versions\nUse Android Cache Fix Plugin 2.6.0 when using an older Kotlin Gradle Plugin version.\n* Supported Kotlin versions: \\[1.3.72-1.5.32\\]\n\n## Learn more\n\nVisit our website to learn more about [Develocity][develocity].\n\n## License\n\nThe Android Cache Fix Gradle plugin is open-source software released under the [Apache 2.0 License][apache-license].\n\n[android-cache-fix-plugin]: https://github.com/gradle/android-cache-fix-gradle-plugin\n[ccud-gradle-plugin]: https://github.com/gradle/common-custom-user-data-gradle-plugin\n[ccud-maven-extension]: https://github.com/gradle/common-custom-user-data-maven-extension\n[develocity-build-config-samples]: https://github.com/gradle/develocity-build-config-samples\n[develocity-build-validation-scripts]: https://github.com/gradle/develocity-build-validation-scripts\n[develocity-oss-projects]: https://github.com/gradle/develocity-oss-projects\n[quarkus-build-caching-extension]: https://github.com/gradle/quarkus-build-caching-extension\n[develocity]: https://gradle.com/develocity\n[apache-license]: https://www.apache.org/licenses/LICENSE-2.0.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgradle%2Fandroid-cache-fix-gradle-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgradle%2Fandroid-cache-fix-gradle-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgradle%2Fandroid-cache-fix-gradle-plugin/lists"}