Status Update
Comments
li...@gmail.com <li...@gmail.com> #2
ch...@google.com <ch...@google.com>
li...@gmail.com <li...@gmail.com> #3
Could you please attach a sample project that shows this issue? Or please explain where and how the resource is defined and referenced.
je...@google.com <je...@google.com>
sp...@google.com <sp...@google.com> #4
Sample project is linked in #1, along with a repro step. Is anything still missing?
ra...@google.com <ra...@google.com>
pa...@google.com <pa...@google.com>
pa...@google.com <pa...@google.com> #5
li...@gmail.com <li...@gmail.com> #6
pa...@google.com <pa...@google.com> #7
I understand that this is an old issue and I am just starting to investigate this. Is this still a problem?
pa...@google.com <pa...@google.com> #8
sa...@google.com <sa...@google.com> #10
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 Electric Eel Beta 4 (2022.1.1.14)
- Android Gradle Plugin 7.4.0-beta04
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!
sa...@google.com <sa...@google.com> #11
The fixes for this issue are now also available in:
- Android Studio Flamingo Canary 7 (2022.2.1.7)
- Android Gradle Plugin 8.0.0-alpha07
We encourage you to try the latest update.
If you notice further issues or have questions, please file a new bug report.
li...@gmail.com <li...@gmail.com> #12
Hi again! After the Electric Eel release I went back to this issue. Using the same demo project I update the AGP to 7.4.0, Gradle to 7.5.1, Lint SDK to 30.4.0 and target/compile SDKs to 33. I ran the test, which was previously failing, and it still fails!
Could you please confirm, that after the fix, the issue is no longer reproducible in the demo project, which I shared in the opening message?
pa...@google.com <pa...@google.com>
li...@gmail.com <li...@gmail.com> #14
li...@gmail.com <li...@gmail.com> #15
I can confirm that the issue is fixed. Updating AGP to 8.0 and lint apis to 31.0.0 helps.
Description
DESCRIBE THE ISSUE IN DETAIL:
STEPS TO REPRODUCE:
./gradlew :app:lintDebug
and observe 2 issues;./gradlew :lint-checks:test
and observe tests failing.It looks like
PartialResult#map
doesn't follow the contract in unit tests. It claims to returnLintMap
for the project in context, but under the certain condition it seems to be violated.The conditions require multimodule setup. A
library
module must put smth into itsLintMap
. Then, when theapp
module accesses its ownLintMap
for the first time it get a map prefilled with the data from thelibrary
module, instead of the fresh one.To demonstrate the issue I created the following setup:
:app
module and a:library
module;:app
module containsapp_color
color resource, while:library
module contains:library_color
;color
resource declaration within the module, puts into the partial results and then reports all colors found per module incheckPartialResults
method;If you run lint checks using the
./gradlew :app:lintDebug
command, you'll observe Lint correctly reportingapp_color
found in:app
andlibrary_color
found in:library
. However, if you run the unit tests, you'll observe that Lint also reports alibrary_color
found in the:app
.It looks like while scanning the
:app
module, the first access to partial results, causesLintCliClient
to create new instance of results and fill it with results of the dependent module (seeLintCliClient#getPartialResults
method). For some reason this is happening only in tests.The replacement of the
getPartialResult.map()
method call withgetPartialResult.mapFor(context.project)
method call successfully addresses the issue.There's still a chance, that my test is wrong. In this case, would be great to know in which way.
Studio Build: Chipmunk | 2021.2.1 Version of Gradle Plugin: 7.2.1, 7.4.0-alpha08 Version of Gradle: 7.4.2 OS: Mac OS Monteray 12.4