gradle/android-cache-fix-gradle-plugin — 525★ trên GitHub (Groovy). Gradle plugin that fixes Android build caching problems.
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
This repository is maintained by the Develocity Solutions team, as one of several publicly available repositories:
Android Cache Fix Gradle Plugin (this repository)
Common Custom User Data Gradle Plugin
Common Custom User Data Maven Extension
Common Custom User Data sbt Plugin
Develocity Build Configuration Samples
Develocity Build Validation Scripts
Develocity Open Source Projects
Quarkus Build Caching Extension
Android Cache Fix Gradle Plugin
Some 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.
Supported Gradle versions: 7.0+
Supported Android Gradle Plugin versions: 7.0+, including alpha, beta, and rc versions
Supported Kotlin versions: 1.7.0+
We 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.
The Android cache fix plugin is compatible with the Gradle Configuration Cache 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.
Should I use this?
Take a look at the list of issues especially unresolved issues. If any of these apply to your project, you can use this plugin to solve them.
How can I discover issues?
You can discover issues by using the task input comparison tool in Develocity. More information about how to diagnose cache misses here. 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.
If you discover an issue related to the Android Gradle Plugin, please file an issue in the Android Bug Tracker. You can also file an issue here and we can see if a workaround is possible.
Applying the plugin
This 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.
Kotlin
// in build.grade.kts for convention plugin build
dependencies {
// ...
implementation("org.gradle.android.cache-fix:org.gradle.android.cache-fix.gradle.plugin:3.0.2")
// ...
}
// in com.myconventions.build.gradle.kts
plugins {
id("com.android.application") // or "com.android.library"
// Add this next line to your existing convention plugin.
id("org.gradle.android.cache-fix")
}
Groovy
// in build.grade for convention plugin build
dependencies {
// ...
implementation("org.gradle.android.cache-fix:org.gradle.android.cache-fix.gradle.plugin:3.0.2")
// ...
}
// in com.myconventions.build.gradle
plugins {
id 'com.android.application' // or 'com.android.library'
// Add this next line to your existing convention plugin.
id 'org.gradle.android.cache-fix'
}
If 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.
plugins {
id "org.gradle.android.cache-fix" version "3.0.2" apply false
}
subprojects {
plugins.withType(com.android.build.gradle.api.AndroidBasePlugin) {
project.apply plugin: "org.gradle.android.cache-fix"
}
}
List of issues
You can take a look at the list of issues that the plugin fixes by looking at the classes in 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:
/**
* Fix {@link org.gradle.api.tasks.compile.CompileOptions#getBootClasspath()} introducing relocatability problems for {@link AndroidJavaCompile}.
*/
@AndroidIssue(introducedIn = "3.0.0", fixedIn = "3.1.0-alpha06", link = "https://issuetracker.google.com/issues/68392933")
static class AndroidJavaCompile_BootClasspath_Workaround implements Workaround {
// ...
}
Unresolved Issues
Please vote for the linked issues if you are experiencing them in your project.
Fixed by the Android Cache Fix plugin, but unresolved in any current or upcoming preview release of the Android Gradle Plugin:
Not fixed by the Android Cache Fix plugin since it has no workaround but is fixed in Android Gradle Plugin 9.2.0 or newer:
Not fixed by the Android Cache Fix plugin since it has no workaround but is fixed in Android Gradle Plugin 8.0.0 or newer:
MergeResources is not relocatable: https://issuetracker.google.com/issues/246529491
Room
The Room annotation processor causes cache misses: https://issuetracker.google.com/issues/132245929.
To work around this issue, please apply the Room Gradle Plugin.
Implementation Notes
MergeNativeLibs, StripDebugSymbols, MergeJavaResources, MergeSourceSetFolders, BundleLibraryClassesJar, DataBindingMergeDependencyArtifacts, LibraryJniLibs and ZipMerging Workarounds
It 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.
Older Android Gradle Plugin Versions
Use Android Cache Fix Plugin 2.4.6 when using an older Android Gradle Plugin version.
gradle/android-cache-fix-gradle-plugin thuộc nhóm Mobile trên TopGit, cùng 2 topic GitHub. Trang Trending và Topics liệt kê các repo cùng số sao và cùng ngôn ngữ để so sánh.
Đọc thêm về gradle/android-cache-fix-gradle-plugin ở đâu?
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/gradle/android-cache-fix-gradle-plugin là nguồn chính thức.
gradle/android-cache-fix-gradle-plugin có bao nhiêu sao?
gradle/android-cache-fix-gradle-plugin có 525 sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/gradle/android-cache-fix-gradle-plugin. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
gradle/android-cache-fix-gradle-plugin có phải mã nguồn mở không?
Có — gradle/android-cache-fix-gradle-plugin phát hành theo license Apache-2.0, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/gradle/android-cache-fix-gradle-plugin.
gradle/android-cache-fix-gradle-plugin có trang demo không?
Dự án có trang chủ ở https://plugins.gradle.org/plugin/org.gradle.android.cache-fix. Tab "Readme" ở trang này thường có ảnh chụp và hướng dẫn bắt đầu nhanh.
gradle/android-cache-fix-gradle-plugin là gì?
gradle/android-cache-fix-gradle-plugin (gradle/android-cache-fix-gradle-plugin) là dự án Groovy trên GitHub. Theo mô tả gốc: Gradle plugin that fixes Android build caching problems.
gradle/android-cache-fix-gradle-plugin so với các dự án Mobile khác thế nào?
gradle/android-cache-fix-gradle-plugin được TopGit xếp vào nhóm Mobile, với 525 sao GitHub và viết bằng Groovy. Xem trang chủ đề Mobile trên TopGit để so sánh với các dự án tương tự theo số sao và mức độ hoạt động.
Đọc đầy đủ README ở tab phía trên.
Chưa chắc android-cache-fix-gradle-plugin có hợp với bạn?
Để ChatGPT, Claude hoặc Perplexity tìm hiểu giúp — bấm bên dưới và xem AI nói gì về android-cache-fix-gradle-plugin.