Status Update
Comments
fn...@gmail.com <fn...@gmail.com> #2
Thanks for the excellent bug report!
ch...@google.com <ch...@google.com> #4
Ime is not necessary part of repro, relayout does it.
@Composable
private fun TextCrash() {
val infiniteTransition = rememberInfiniteTransition(label = "infinite transition")
val padding by infiniteTransition.animateFloat(
initialValue = 0f,
targetValue = 50f,
animationSpec = infiniteRepeatable(tween(1000), RepeatMode.Reverse),
label = "I like to move it move it"
)
Box(
modifier = Modifier
.padding(padding.toInt().dp)
.fillMaxSize(),
contentAlignment = Alignment.Center
) {
Column(verticalArrangement = Arrangement.spacedBy(12.dp)) {
Text(
text = "Hello Android!".repeat(5),
textAlign = TextAlign.Center,
letterSpacing = 1.sp,
overflow = TextOverflow.Ellipsis,
maxLines = 1
)
}
}
}
ap...@google.com <ap...@google.com> #5
This is the minimal TextStyle to repro
ap...@google.com <ap...@google.com> #6
TextStyle(
textAlign = TextAlign.Center,
letterSpacing = 1.sp,
lineHeight = 24.sp,
lineHeightStyle = LineHeightStyle(
alignment = LineHeightStyle.Alignment.Center,
trim = LineHeightStyle.Trim.None,
mode = LineHeightStyle.Mode.Fixed
),
)
ap...@google.com <ap...@google.com> #7
Fix coming. Will see if I can get it into 1.8-beta01.
ap...@google.com <ap...@google.com> #8
Amazing! That was super quick)
ap...@google.com <ap...@google.com> #9
Excellent bug report and I had some idle cycles this week :)
ap...@google.com <ap...@google.com> #10
Branch: 3.3
commit 8f8e157c74d3719994f4042b68e59f3a7911d594
Author: Christoffer Quist Adamsen <christofferqa@google.com>
Date: Tue Jun 21 12:27:30 2022
Version 3.3.62
Bug:
Change-Id: I4ace691f8a0a31c53585af18cf903d106e263bc3
M src/main/java/com/android/tools/r8/Version.java
ap...@google.com <ap...@google.com> #11
Branch: 3.3
commit adeda943468ba92d02e0e17fbfb68d5ef3acd2f5
Author: Christoffer Quist Adamsen <christofferqa@google.com>
Date: Tue Jun 21 12:25:04 2022
Fix inadequate rewriting of enum array types after enum unboxing
Bug:
Change-Id: I53b65574a82d3c84b0591ab00c2552a089c5e1ec
M src/main/java/com/android/tools/r8/ir/optimize/enums/EnumUnboxerImpl.java
A src/test/java/com/android/tools/r8/enumunboxing/NullAssignmentToArrayTypeEnumUnboxingTest.java
ap...@google.com <ap...@google.com> #12
Branch: 3.1
commit 1c0acf5957acfbc2f784a89a4e41e56dcfac7e5f
Author: Christoffer Quist Adamsen <christofferqa@google.com>
Date: Tue Jun 21 13:30:16 2022
Fix inadequate rewriting of enum array types after enum unboxing
Bug:
Change-Id: I53b65574a82d3c84b0591ab00c2552a089c5e1ec
A src/test/java/com/android/tools/r8/enumunboxing/NullAssignmentToArrayTypeEnumUnboxingTest.java
M src/main/java/com/android/tools/r8/ir/optimize/enums/EnumUnboxer.java
ap...@google.com <ap...@google.com> #13
Branch: 3.2
commit ca37e6c25fcd32df549bf72f619e6f58deb905b3
Author: Christoffer Quist Adamsen <christofferqa@google.com>
Date: Tue Jun 21 13:18:01 2022
Fix inadequate rewriting of enum array types after enum unboxing
Bug:
Change-Id: I53b65574a82d3c84b0591ab00c2552a089c5e1ec
M src/main/java/com/android/tools/r8/ir/optimize/enums/EnumUnboxerImpl.java
A src/test/java/com/android/tools/r8/enumunboxing/NullAssignmentToArrayTypeEnumUnboxingTest.java
ap...@google.com <ap...@google.com> #14
Branch: 3.1
commit 1c0acf5957acfbc2f784a89a4e41e56dcfac7e5f
Author: Christoffer Quist Adamsen <christofferqa@google.com>
Date: Tue Jun 21 13:30:16 2022
Fix inadequate rewriting of enum array types after enum unboxing
Bug:
Change-Id: I53b65574a82d3c84b0591ab00c2552a089c5e1ec
A src/test/java/com/android/tools/r8/enumunboxing/NullAssignmentToArrayTypeEnumUnboxingTest.java
M src/main/java/com/android/tools/r8/ir/optimize/enums/EnumUnboxer.java
ch...@google.com <ch...@google.com> #15
This should now be fixed in R8 3.1.79, 3.2.70, and 3.3.62.
fn...@gmail.com <fn...@gmail.com> #16
ch...@google.com <ch...@google.com> #17
Yes they are already available. You should be able to see the most recent version for a specific branch by looking at the commits to that branch, e.g.,
fn...@gmail.com <fn...@gmail.com> #18
Apologies if I'm missing something, but trying to use 3.1.79 fails with
Caused by: org.gradle.internal.resolve.ModuleVersionNotFoundException: Could not find com.android.tools:r8:3.1.79.
while other versions work fine. Also that tag isn't present in the repository after pulling, and isn't listed on
ch...@google.com <ch...@google.com> #19
You can build with any R8 release version by adding the following to settings.gradle
.
pluginManagement {
buildscript {
repositories {
mavenCentral()
maven {
url = uri("https://storage.googleapis.com/r8-releases/raw")
}
}
dependencies {
classpath("com.android.tools:r8:3.1.79")
classpath('com.google.guava:guava:30.1.1-jre') // Required until R8 3.2.4-dev
}
}
}
de...@google.com <de...@google.com> #20
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 Dolphin Beta 5 (2021.3.1.14)
- Android Gradle Plugin 7.3.0-beta05
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!
Description
Or at least I think that's what happening. Here's bits of the code of interest:
Instantiating
Hdata
fails at runtime with the error:Note that there's a call to
getObject$enumunboxing$
in the trace. DisassemblingHdata
class (by the way of Analyze APK → Show bytecode) yields:I read this as the class having a field
type_list
of type array of integers. While the init method tries writing to it a null value of type array ofWType
. I suppose R8 tries optimizing the enum by converting it to integers, which is sensible, but forgets to change the init method as well somehow.On of our devs reported that this error doesn't happen when using r8 3.1.6-dev but happens in 3.1.7-dev. It also happens in 3.3.28 (current stable) and 4.0.12-dev (of today).
I am attaching two APKs, one built with 3.3.28 (3487e52) and one with 3.1.6-dev (f116b93), as well as the decompiled the version change between the two commits (the comment in the code is outdated) and the source for Hdata . The APKs come directly from our CI, the app os open source.
Hdata
bytecode for both of the files. Here'sP.S. Android Studio shows the bytecode for 3487e52 with stuff like this:
The total number of lines is 12.5k, versus 299 for f116b93, which don't have these weird lines. What's up with this?