Status Update
Comments
uc...@google.com <uc...@google.com> #2
th...@gmail.com <th...@gmail.com> #3
uc...@google.com <uc...@google.com>
th...@gmail.com <th...@gmail.com> #4
We use ViewBinding in more and more places and lint keeps reporting unused resources for every file referenced via ViewBinding.
es...@google.com <es...@google.com>
di...@google.com <di...@google.com>
da...@google.com <da...@google.com>
da...@google.com <da...@google.com> #5
da...@google.com <da...@google.com> #6
Now that I've been able to look a little closer, I see what's going on. Our lint solution (at least for view binding) handles LayoutBinding.inflate
but not LayoutBinding::inflate
I'll look into fixing this ASAP but it probably won't land until 4.1
Until then, a workaround could be to change lines like this:
override val binding: ActivityAboutBinding by viewBinding(ActivityAboutBinding::inflate)
into:
override val binding: ActivityAboutBinding by viewBinding { ActivityAboutBinding.inflate(it) }
da...@google.com <da...@google.com> #7
This fix will land in 4.1 Canary 11. Until then, the only thing I can think to suggest is the workaround in
be...@crisalid.com <be...@crisalid.com> #8
da...@google.com <da...@google.com> #9
ce...@gmail.com <ce...@gmail.com> #10
da...@google.com <da...@google.com> #11
Hey
ce...@gmail.com <ce...@gmail.com> #12
I'm sorry, for some reason I didn't receive any notification about your comment.
Tried with AGP 4.2-beta06 and issue is fixed.
da...@google.com <da...@google.com> #13
No worries, thanks for the confirmation!
Description
Version of Gradle Plugin: 3.6.0-alpha12
Version of Gradle: 5.6.2
Version of Java: 1.8.0_212
OS: Windows / macOS
Steps to Reproduce:
1. Enable view binding and reference layout files with new static binding classes
2. Run "Refactor>Remove Unused Resources"