Assigned
Status Update
Comments
se...@google.com <se...@google.com> #2
Please look at attached sample project
po...@gmail.com <po...@gmail.com> #3
Corresponding dump which reproduces. Seems to be a lir issue.
se...@google.com <se...@google.com> #4
Yeah so the issue is that we have in a single method:
super.setOnClickListener(l)
child.setOnClickListener(l)
Now the lookup results are different since it's super/virtual invoke:
void android.view.ViewGroup.setOnClickListener(android.view.View$OnClickListener)
void android.view.View.setOnClickListener(android.view.View$OnClickListener)
Leading to:
Unexpected rewriting of item: void androidx.constraintlayout.widget.ConstraintLayout.setOnClickListener(android.view.View$OnClickListener) to two distinct items: void android.view.View.setOnClickListener(android.view.View$OnClickListener) and void android.view.ViewGroup.setOnClickListener(android.view.View$OnClickListener)
Because in LirRewriting the constantPoolMapping has only item->item mapping and does not take into account invoke type (super vs virtual in this case)
It looks like it's an issue of the LirLensCodeRewriter which should either take into account invoke type, or we should rewrite through high level IR in this case.
se...@google.com <se...@google.com> #5
I reassign to @christofferqa who may fix it next week (Related code is his code so he may be the best person to fix this).
se...@google.com <se...@google.com> #6
After updating to AGP 8.5.1 I am getting similar error:
ERROR: R8: com.android.tools.r8.internal.Lk0: Unexpected rewriting of item: void com.google.android.material.textfield.TextInputEditText.setTextSize(float) to two distinct items: void android.widget.TextView.setTextSize(float) and void android.widget.EditText.setTextSize(float)
ERROR: R8: com.android.tools.r8.internal.Lk0: Unexpected rewriting of item: void com.google.android.material.textfield.TextInputEditText.setTextSize(float) to two distinct items: void android.widget.TextView.setTextSize(float) and void android.widget.EditText.setTextSize(float)
se...@google.com <se...@google.com> #7
Project: r8
Branch: main
commit 730c15e21ee3eaf46784d7619a26d62a5e7ac427
Author: Christoffer Adamsen <christofferqa@google.com>
Date: Tue Jul 30 11:31:15 2024
Reproduce collision in lir rewriting
Bug: b/354878031
Change-Id: Id9cb083513e5f5bcf59c283c75c8bd6e1c3f47e2
A src/test/java/com/android/tools/r8/lightir/LirLensRewritingWithOneToManyMappingTest.java
https://r8-review.googlesource.com/94446
Branch: main
commit 730c15e21ee3eaf46784d7619a26d62a5e7ac427
Author: Christoffer Adamsen <christofferqa@google.com>
Date: Tue Jul 30 11:31:15 2024
Reproduce collision in lir rewriting
Bug:
Change-Id: Id9cb083513e5f5bcf59c283c75c8bd6e1c3f47e2
A src/test/java/com/android/tools/r8/lightir/LirLensRewritingWithOneToManyMappingTest.java
po...@gmail.com <po...@gmail.com> #8
Project: r8
Branch: main
commit 81c70458a5867e95dd11b5bd750e0a64da0811a0
Author: Christoffer Adamsen <christofferqa@google.com>
Date: Tue Jul 30 14:20:05 2024
Account for collisions in lir rewriting
Bug: b/354878031
Change-Id: I0f141936f2835497fa6553a0e260f4d7fb04d20b
M src/main/java/com/android/tools/r8/lightir/LirLensCodeRewriter.java
M src/test/java/com/android/tools/r8/lightir/LirLensRewritingWithOneToManyMappingTest.java
https://r8-review.googlesource.com/94447
Branch: main
commit 81c70458a5867e95dd11b5bd750e0a64da0811a0
Author: Christoffer Adamsen <christofferqa@google.com>
Date: Tue Jul 30 14:20:05 2024
Account for collisions in lir rewriting
Bug:
Change-Id: I0f141936f2835497fa6553a0e260f4d7fb04d20b
M src/main/java/com/android/tools/r8/lightir/LirLensCodeRewriter.java
M src/test/java/com/android/tools/r8/lightir/LirLensRewritingWithOneToManyMappingTest.java
se...@google.com <se...@google.com> #9
Project: r8
Branch: 8.5
commit c7acb443063dedec73d460fb14e64e82abb5cb64
Author: Christoffer Adamsen <christofferqa@google.com>
Date: Tue Jul 30 14:34:33 2024
Reproduce collision in lir rewriting
Bug: b/354878031
Change-Id: Id9cb083513e5f5bcf59c283c75c8bd6e1c3f47e2
A src/test/java/com/android/tools/r8/lightir/LirLensRewritingWithOneToManyMappingTest.java
https://r8-review.googlesource.com/94543
Branch: 8.5
commit c7acb443063dedec73d460fb14e64e82abb5cb64
Author: Christoffer Adamsen <christofferqa@google.com>
Date: Tue Jul 30 14:34:33 2024
Reproduce collision in lir rewriting
Bug:
Change-Id: Id9cb083513e5f5bcf59c283c75c8bd6e1c3f47e2
A src/test/java/com/android/tools/r8/lightir/LirLensRewritingWithOneToManyMappingTest.java
Description
Jetpack Compose version: 1.7.6
Jetpack Compose component used:
Android Studio Build: Ladybug Feature Drop 2024.2.2
Kotlin version: 2.1.0
Devices/Android versions reproduced on: Phone Emulator (API 34)
Keyboard (i.e. Gboard, Samsung, etc): AOSP Keyboard
If you have Material text
inside the layout with
Modifier.imePadding()
applied to it, and trigger the appearance of the soft keyboard, then text starts to move to the right of the screen.This bug is very similar to this one and is probably related to this code (it was introduced here ).
Screenshots and video attached.