Status Update
Comments
km...@google.com <km...@google.com>
je...@google.com <je...@google.com>
hu...@google.com <hu...@google.com> #2
Thank you for this report!
Root cause
The existing OutputMapping
computation in DexArchiveBuilderTaskDelegate
ensures that the dexing task runs incrementally only if the jars' file paths are unchanged (to avoid
Given that condition, we then assert that the jars must not be reported as REMOVED
. However, as shown in this bug, that assertion may sometimes still fail.
There are a few explanations:
-
The jar's position has changed. In that case, Gradle will report the jar as both
REMOVED
andADDED
. However, we have a preprocessing step inDexArchiveBuilderTask
to keep theADDED
file change only, so it must be something else. -
The jar is moved from one scope to another (e.g., from
SUBPROJECT_SCOPE
toMIXED_SCOPE
). Since we get the changes per scope and the preprocessing for moved files is also done per scope, we would see the jar asREMOVED
fromSUBPROJECT_SCOPE
andADDED
inMIXED_SCOPE
. BecauseOutputMapping
computation looks at all the scopes together, it will see the jar as bothREMOVED
andADDED
. -
Gradle normalizes the paths when detecting changes, so it may report a file as
REMOVED
even though its absolute path is unchanged (seehttps://github.com/gradle/gradle/issues/27061 ).
Fix
To address this issue, we will remove the assertion as it is not strictly required. When the jar is reported as changed (regardless of whether the change is REMOVED
, MODIFIED
, or ADDED
), we will recompute the jar's hash.
hu...@google.com <hu...@google.com> #3
an...@google.com <an...@google.com> #4
Thank you for your patience while our engineering team worked to resolve this issue. A fix for this issue is now available in:
- Android Studio Iguana | 2023.2.1 Canary 15
- Android Gradle Plugin 8.3.0-alpha15
We encourage you to try the latest update.
If you notice further issues or have questions, please file a new bug report.
Thank you for taking the time to submit feedback — we really appreciate it!
ha...@gmail.com <ha...@gmail.com> #5
Top
Description
DESCRIBE THE ISSUE IN DETAIL:
I'm sorry that I cannot provide reproducible project, because this error is related with incremental build only, and hard to reproducible.
I have a large Android Project.
And there are several library modules which are not included java or kotlin sources.
Sometimes (about 1-2%) I find errors like the one below.
And it seems this exception raised athttps://cs.android.com/android-studio/platform/tools/base/+/mirror-goog-studio-main:build-system/gradle-core/src/main/java/com/android/build/gradle/internal/tasks/DexArchiveBuilderTaskDelegate.kt;l=553-555
After added dummy source code in resource only library, this compile errors have disappeared.
ATTACH SCREENSHOTS/RECORDINGS OF THE ISSUE
ATTACH LOG FILES (Select Help > Show Log in Files, or Show Log in Finder on a Mac)
IMPORTANT: Please readhttps://developer.android.com/studio/report-bugs.html carefully and supply
all required information.
Studio Build: Any
Version of Gradle Plugin: 8.0, 8.1
Version of Gradle: 8.2, 8.3, 8,4
Version of Java: OpenJDK 17
OS: Any