Fixed
Status Update
Comments
sp...@google.com <sp...@google.com> #2
Please look at attached sample project
da...@google.com <da...@google.com> #3
Corresponding dump which reproduces. Seems to be a lir issue.
sp...@google.com <sp...@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.
da...@google.com <da...@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).
sp...@google.com <sp...@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)
sp...@google.com <sp...@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
sp...@google.com <sp...@google.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
sp...@google.com <sp...@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
an...@google.com <an...@google.com> #10
Project: r8
Branch: 8.5
commit 2c176ec131a9edb97721fb8578b7fbb462376632
Author: Christoffer Adamsen <christofferqa@google.com>
Date: Tue Jul 30 15:06:38 2024
Version 8.5.35
Bug: b/354878031
Change-Id: Idb5334baeec9bae3ac86fadab80bb7d6476523cb
M src/main/java/com/android/tools/r8/Version.java
https://r8-review.googlesource.com/94567
Branch: 8.5
commit 2c176ec131a9edb97721fb8578b7fbb462376632
Author: Christoffer Adamsen <christofferqa@google.com>
Date: Tue Jul 30 15:06:38 2024
Version 8.5.35
Bug:
Change-Id: Idb5334baeec9bae3ac86fadab80bb7d6476523cb
M src/main/java/com/android/tools/r8/Version.java
an...@google.com <an...@google.com> #11
Project: r8
Branch: 8.5
commit 09b617180bba086b1680da94006fd666d38a9c8d
Author: Christoffer Adamsen <christofferqa@google.com>
Date: Tue Jul 30 15:06:29 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/94545
Branch: 8.5
commit 09b617180bba086b1680da94006fd666d38a9c8d
Author: Christoffer Adamsen <christofferqa@google.com>
Date: Tue Jul 30 15:06:29 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
Description
I want to add a new asset directory to the Android instrumentation tests via the Variant API, but it is not working as the DSL API. I have attached a sample project that reproduces the issue.
In the
build.gradle.kts
I have:but when I run my test that validates that the asset file is present, it fails:
I can also see the APK is missing the files:
if I comment out the Variant APIs lines above and instead use the 'older' DSL:
then things work as expected:
and the APK also contains the expected asset files:
Let me know if you need any more information.