You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you're using Paraphrase then you may never reference a formatted string resource directly in your Kotlin code - you do it indirectly through the generated Paraphrase code. UnusedResourceDetector doesn't seem to pick up those indirect references, so it reports UnusedResources lint errors.
On one hand, a reference in the generated Paraphrase shouldn't automatically mark a resource is used. If the Paraphrase function is never called then the resource really is unused. But if the Paraphrase function is called, that would ideally be enough to satisfy lint.
I haven't looked into how UnusedResourceDetector works, so I'm not sure what options we have to mitigate this.
The text was updated successfully, but these errors were encountered:
This came up a lot with Butter Knife where resource references would only exist in the generated code. I had good success reporting these to Google. It's a little different because it's annotation processor-generated code vs Gradle plugin-generated code, but it simply may be Lint isn't running over the code generated by the mechanism we're using.
Actually as soon as I hit send I also remember this coming up when building view binding. I don't recall the outcome of that, though. Lint has a full call graph analysis framework so it should be able to trace unused functions to unused resource references.
If you're using Paraphrase then you may never reference a formatted string resource directly in your Kotlin code - you do it indirectly through the generated Paraphrase code.
UnusedResourceDetector
doesn't seem to pick up those indirect references, so it reportsUnusedResources
lint errors.On one hand, a reference in the generated Paraphrase shouldn't automatically mark a resource is used. If the Paraphrase function is never called then the resource really is unused. But if the Paraphrase function is called, that would ideally be enough to satisfy lint.
I haven't looked into how
UnusedResourceDetector
works, so I'm not sure what options we have to mitigate this.The text was updated successfully, but these errors were encountered: