Status Update
Comments
xa...@google.com <xa...@google.com>
sg...@google.com <sg...@google.com> #2
Retraced stack trace:
Caused by: java.lang.UnsupportedOperationException: Operation is not supported for read-only collection
at com.android.tools.r8.jetbrains.kotlin.collections.EmptyList.removeAll(Collections.kt)
at com.android.tools.r8.resourceshrinker.r8integration.LegacyResourceShrinker.run(LegacyResourceShrinker.java:228)
at com.android.tools.r8.R8.shrinkResources(R8.java:991)
at com.android.tools.r8.R8.runInternal(R8.java:894)
at com.android.tools.r8.R8.runInternal(R8.java:259)
at com.android.tools.r8.R8.lambda$runForTesting$1(R8.java:243)
at com.android.tools.r8.internal.Nu.a(R8_8.9.27_3afcc9fea5cc5cd06373667ec09d5fe106db8a4a77576689534e667542385a93:28
ri...@google.com <ri...@google.com> #3
This is happening when there are no unused resources at all and we have duplicated resources between the feature and base (or different features)
Reproduction here:
Fix here:
For the reporter to work around this:
- Disable resource shrinking in this case, it will have no effect since there are no unused resources for this build
- Use legacy AGP embedded shrinker - set android.r8.integratedResourceShrinking false in your settings
- Manually update to a new R8 version (I will post a follow up when this is on our release branch)
ma...@marcardar.com <ma...@marcardar.com> #4
Thanks!
ap...@google.com <ap...@google.com> #5
Project: r8
Branch: main
Author: Rico Wind <
Link:
Fix usage of Immutable list in resource shrinker
Expand for full commit details
Fix usage of Immutable list in resource shrinker
The returned list is mutable unless it is empty, allways create a copy.
Bug: b/401546693
Change-Id: I9ea50d23c365ea59e1f6ae5e13a02048daa8b5f8
Files:
- M
src/resourceshrinker/java/com/android/build/shrinker/r8integration/LegacyResourceShrinker.java
- M
src/test/java/com/android/tools/r8/androidresources/DuplicatedEntriesEmptyUnusedTest.java
Hash: dc5cae852ee11d42456d275afb1837d1f770306f
Date: Mon Mar 10 17:56:18 2025
ap...@google.com <ap...@google.com> #6
Project: r8
Branch: main
Author: Rico Wind <
Link:
Add reproduction of adding to immutable list in resource shrinker
Expand for full commit details
Add reproduction of adding to immutable list in resource shrinker
This happens if the list returned from the model is empty, in which case it is immutable
Bug: b/401546693
Change-Id: Ib596242df6e3299f19ff00a03dbe43bde79e13c0
Files:
- A
src/test/java/com/android/tools/r8/androidresources/DuplicatedEntriesEmptyUnusedTest.java
Hash: 429ddad6ffce418ebaf482277ee8e96a68ab18e4
Date: Mon Mar 10 17:51:07 2025
ap...@google.com <ap...@google.com> #7
Project: r8
Branch: 8.9
Author: Rico Wind <
Link:
Add reproduction of adding to immutable list in resource shrinker
Expand for full commit details
Add reproduction of adding to immutable list in resource shrinker
This happens if the list returned from the model is empty, in which case it is immutable
Bug: b/401546693
Change-Id: Ib596242df6e3299f19ff00a03dbe43bde79e13c0
Files:
- A
src/test/java/com/android/tools/r8/androidresources/DuplicatedEntriesEmptyUnusedTest.java
Hash: 2f90d4133d2af07c954dceddb1ae47cc28e7b9d8
Date: Tue Mar 11 10:54:07 2025
ap...@google.com <ap...@google.com> #8
Project: r8
Branch: 8.9
Author: Rico Wind <
Link:
Fix usage of Immutable list in resource shrinker
Expand for full commit details
Fix usage of Immutable list in resource shrinker
The returned list is mutable unless it is empty, allways create a copy.
Bug: b/401546693
Change-Id: I9ea50d23c365ea59e1f6ae5e13a02048daa8b5f8
Files:
- M
src/resourceshrinker/java/com/android/build/shrinker/r8integration/LegacyResourceShrinker.java
- M
src/test/java/com/android/tools/r8/androidresources/DuplicatedEntriesEmptyUnusedTest.java
Hash: 5e687ec23a4cdb897cbd2cdccc75ff956d99c88c
Date: Tue Mar 11 10:54:12 2025
ap...@google.com <ap...@google.com> #9
Project: r8
Branch: 8.9
Author: Rico Wind <
Link:
Version 8.9.32
Expand for full commit details
Version 8.9.32
Bug: b/401546693
Change-Id: Ibed0928d2ac5c2b649516ce2a4918ad04da0b0e7
Files:
- M
src/main/java/com/android/tools/r8/Version.java
Hash: 3daff1971b739cc421cbc79ff63f8e54cf3ae2ed
Date: Tue Mar 11 10:54:18 2025
ri...@google.com <ri...@google.com> #10
As a follow up to the last comment, you can try version 8.9.32 with the instructions from here:
That should make the compilation succeed
ap...@google.com <ap...@google.com> #11
Project: r8
Branch: 8.10
Author: Rico Wind <
Link:
Version 8.10.17
Expand for full commit details
Version 8.10.17
Bug: b/401546693
Change-Id: I0f46c848db5653a9a7728f6f38ab305ac1dac80d
Files:
- M
src/main/java/com/android/tools/r8/Version.java
Hash: 5cb0d6c73b79a70b23b4717529431e18e2501c7a
Date: Tue Mar 11 10:53:16 2025
ap...@google.com <ap...@google.com> #12
Project: r8
Branch: 8.10
Author: Rico Wind <
Link:
Add reproduction of adding to immutable list in resource shrinker
Expand for full commit details
Add reproduction of adding to immutable list in resource shrinker
This happens if the list returned from the model is empty, in which case it is immutable
Bug: b/401546693
Change-Id: Ib596242df6e3299f19ff00a03dbe43bde79e13c0
Files:
- A
src/test/java/com/android/tools/r8/androidresources/DuplicatedEntriesEmptyUnusedTest.java
Hash: 3867edebfc19c949d55427b1f1774ba25539646e
Date: Tue Mar 11 10:53:02 2025
ap...@google.com <ap...@google.com> #13
Project: r8
Branch: 8.10
Author: Rico Wind <
Link:
Fix usage of Immutable list in resource shrinker
Expand for full commit details
Fix usage of Immutable list in resource shrinker
The returned list is mutable unless it is empty, allways create a copy.
Bug: b/401546693
Change-Id: I9ea50d23c365ea59e1f6ae5e13a02048daa8b5f8
Files:
- M
src/resourceshrinker/java/com/android/build/shrinker/r8integration/LegacyResourceShrinker.java
- M
src/test/java/com/android/tools/r8/androidresources/DuplicatedEntriesEmptyUnusedTest.java
Hash: d3cabf6667451e51d1d2edec5443ecaaadfbea01
Date: Tue Mar 11 10:53:09 2025
ri...@google.com <ri...@google.com>
an...@google.com <an...@google.com> #14
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 Meerkat Feature Drop | 2024.3.2 Beta 1
- Android Gradle Plugin 8.10.0-beta01
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!
an...@google.com <an...@google.com> #15
The fixes for this issue are now also available in:
- Android Studio Meerkat | 2024.3.1 Patch 1
- Android Gradle Plugin 8.9.1
We encourage you to try the latest update.
If you notice further issues or have questions, please file a new bug report.
ma...@marcardar.com <ma...@marcardar.com> #16
Thanks very much for the regular updates. I just tried it out and it works for me.
Description
DESCRIBE THE ISSUE IN DETAIL:
STEPS TO REPRODUCE:
Studio Build: Meerkat 2024.3.1 Version of Gradle Plugin: 8.9.0 (there was no problem in 8.8.2) Version of Gradle: 8.11.1 Version of Java: (Instructing gradle to use java from /Applications/Android Studio.app/Contents/jbr/Contents/Home) OS: macos 15.3.1