Status Update
Comments
ch...@google.com <ch...@google.com>
ap...@google.com <ap...@google.com> #2
AGP 8.8 ships with R8 8.8. If you are using R8 8.3.37 you must explicitly be downgrading R8 several versions. Can you try using the R8 8.8 that ships with AGP 8.8.2?
See also
ch...@google.com <ch...@google.com> #3
I cleared my cache and the entire project, and I directly pointed to version 8.8 in the build.gradle (check attachment), but still the version being used is:
Current version is: 8.3.37 (build 3ccc501316db4344828180e7152a4adb97522bf8 from go/r8bot (luci-r8-custom-ci-focal-17-2jq9)).
I also tried not to define the version of R8, but the same build version is always used.
ap...@google.com <ap...@google.com> #4
Please take a look at pluginManagement
).
ap...@google.com <ap...@google.com> #5
Closing this as WAI since this is due to using an old version of R8 that does not support kotlinx-metadata-jvm 2.1.0. If you are still unable to find the cause of the version downgrade then please let us know.
ap...@google.com <ap...@google.com> #6
Hi team,
Quick update - the issue is now resolved after I manually forced the correct R8 version.
Thank you! Mateusz
ap...@google.com <ap...@google.com> #7
Thank you for reporting back. However, if you have to force the R8 version when using AGP 8.8 it looks as if there is some issue hiding in your setup.
ap...@google.com <ap...@google.com> #8
Project: r8
Branch: 8.9
Author: Christoffer Adamsen <
Link:
Account for assume instructions from if-instance-of in if optimizer
Expand for full commit details
Account for assume instructions from if-instance-of in if optimizer
This fixes an issue where code on the form:
if (o instanceof T) {
T t = (T) o;
} else {
}
... were incorrectly optimized to:
o instanceof T;
T t = (T) o;
This was due to the if optimizer incorrectly concluding that the else-branch always has the same behavior as the then-branch, since the cast to T is guaranteed to succeed in the presence of the assume instruction that has been synthesized for the `o instanceof T` branch.
Bug: b/401515589
Change-Id: Ibac1c72dcba660e4f54bca6b0bdea753482c0a11
Files:
- M
src/main/java/com/android/tools/r8/ir/analysis/equivalence/BasicBlockBehavioralSubsumption.java
Hash: 7915a9b64e0ee46235ef183eb5980292256dbd9c
Date: Thu Mar 13 13:34:26 2025
ap...@google.com <ap...@google.com> #9
Project: r8
Branch: 8.9
Author: Christoffer Adamsen <
Link:
Version 8.9.34
Expand for full commit details
Version 8.9.34
Bug: b/401515589
Change-Id: I1e4656829a2cd3922039c2609f8c06ff494d7aa4
Files:
- M
src/main/java/com/android/tools/r8/Version.java
Hash: 617a573ea43b1798c1323ae6e8832f8f59aa6227
Date: Thu Mar 13 13:34:32 2025
ap...@google.com <ap...@google.com> #10
Project: r8
Branch: 8.10
Author: Christoffer Adamsen <
Link:
Account for assume instructions from if-instance-of in if optimizer
Expand for full commit details
Account for assume instructions from if-instance-of in if optimizer
This fixes an issue where code on the form:
if (o instanceof T) {
T t = (T) o;
} else {
}
... were incorrectly optimized to:
o instanceof T;
T t = (T) o;
This was due to the if optimizer incorrectly concluding that the else-branch always has the same behavior as the then-branch, since the cast to T is guaranteed to succeed in the presence of the assume instruction that has been synthesized for the `o instanceof T` branch.
Bug: b/401515589
Change-Id: Ibac1c72dcba660e4f54bca6b0bdea753482c0a11
Files:
- M
src/main/java/com/android/tools/r8/ir/analysis/equivalence/BasicBlockBehavioralSubsumption.java
Hash: bf0436a33f3daaf9f74b04c255652f7e639b243f
Date: Thu Mar 13 13:34:20 2025
ap...@google.com <ap...@google.com> #11
Project: r8
Branch: 8.10
Author: Christoffer Adamsen <
Link:
Version 8.10.20
Expand for full commit details
Version 8.10.20
Bug: b/401515589
Change-Id: Icbeda500389434400f3ce769171ef2fe937ca08c
Files:
- M
src/main/java/com/android/tools/r8/Version.java
Hash: f12b10ebaddcc78c9c326d026a6e656b91c37d98
Date: Thu Mar 13 13:34:26 2025
ap...@google.com <ap...@google.com> #12
Project: r8
Branch: 8.7
Author: Christoffer Adamsen <
Link:
Account for assume instructions from if-instance-of in if optimizer
Expand for full commit details
Account for assume instructions from if-instance-of in if optimizer
This fixes an issue where code on the form:
if (o instanceof T) {
T t = (T) o;
} else {
}
... were incorrectly optimized to:
o instanceof T;
T t = (T) o;
This was due to the if optimizer incorrectly concluding that the else-branch always has the same behavior as the then-branch, since the cast to T is guaranteed to succeed in the presence of the assume instruction that has been synthesized for the `o instanceof T` branch.
Bug: b/401515589
Change-Id: Ibac1c72dcba660e4f54bca6b0bdea753482c0a11
Files:
- M
src/main/java/com/android/tools/r8/ir/analysis/equivalence/BasicBlockBehavioralSubsumption.java
Hash: 67dabe3933746a2c97e37753ae0f76435aa9b146
Date: Thu Mar 13 13:34:34 2025
ap...@google.com <ap...@google.com> #13
Project: r8
Branch: 8.8
Author: Christoffer Adamsen <
Link:
Account for assume instructions from if-instance-of in if optimizer
Expand for full commit details
Account for assume instructions from if-instance-of in if optimizer
This fixes an issue where code on the form:
if (o instanceof T) {
T t = (T) o;
} else {
}
... were incorrectly optimized to:
o instanceof T;
T t = (T) o;
This was due to the if optimizer incorrectly concluding that the else-branch always has the same behavior as the then-branch, since the cast to T is guaranteed to succeed in the presence of the assume instruction that has been synthesized for the `o instanceof T` branch.
Bug: b/401515589
Change-Id: Ibac1c72dcba660e4f54bca6b0bdea753482c0a11
Files:
- M
src/main/java/com/android/tools/r8/ir/analysis/equivalence/BasicBlockBehavioralSubsumption.java
Hash: 112cc3664414e332b0a8a616eef44c5537683e6a
Date: Thu Mar 13 13:34:30 2025
ap...@google.com <ap...@google.com> #14
Project: r8
Branch: 8.9
Author: Christoffer Adamsen <
Link:
Account for assume instructions from if-instance-of in if optimizer
Expand for full commit details
Account for assume instructions from if-instance-of in if optimizer
This fixes an issue where code on the form:
if (o instanceof T) {
T t = (T) o;
} else {
}
... were incorrectly optimized to:
o instanceof T;
T t = (T) o;
This was due to the if optimizer incorrectly concluding that the else-branch always has the same behavior as the then-branch, since the cast to T is guaranteed to succeed in the presence of the assume instruction that has been synthesized for the `o instanceof T` branch.
Bug: b/401515589
Change-Id: Ibac1c72dcba660e4f54bca6b0bdea753482c0a11
Files:
- M
src/main/java/com/android/tools/r8/ir/analysis/equivalence/BasicBlockBehavioralSubsumption.java
Hash: 7915a9b64e0ee46235ef183eb5980292256dbd9c
Date: Thu Mar 13 13:34:26 2025
Description
AGP 8.9
Encountering a crash during class initialization for a
val
that is being safe cast in the originating source.Crash
Code
Crash occurs where the dex ends up with the result check of the
instance-of
removed and continues on to casting the value. It does seem to keep the check if a method on the typeSharedElementTransitionScope
is used, but not if only the parent typeSharedTransitionScope
is accessed.Minifed
Normal
Sample app
Crash report