Status Update
Comments
jo...@google.com <jo...@google.com>
er...@google.com <er...@google.com> #2
an...@google.com <an...@google.com> #3
Our team is also running into this because we use kotlin reflection to set up mock data for previews.
Can you suggest any workaround that we can apply locally to make layout lib include kotlin reflect until it is officially fixed? We are obviously including it as a build dependency but the layout lib preview doesn't pick it up for some reason.
al...@google.com <al...@google.com> #4
I do not see this issue in Electric Eel Beta 4, but I do see it in Flamingo Canary 6.
al...@google.com <al...@google.com> #5
I do not see this issue in Electric Eel Beta 4, but I do see it in Flamingo Canary 6.
Is it with the very same project? I'm trying to rule out whether this is related to specific library/compiler versions.
Thanks!
bl...@google.com <bl...@google.com>
bl...@google.com <bl...@google.com>
an...@google.com <an...@google.com> #6
Yes, that was with the same project. I can double check with the latest versions of each IDE and get back to you though.
bl...@google.com <bl...@google.com> #7
Correction: I was either mistaken before, or behavior has changed, but I am now getting the KotlinReflectionNotSupportedError
issue for IDE compose previews in both EE Beta 5 and Flamingo Canary 8.
Kotlin 1.6.21 AGP 7.3
Description
Originally found in b/227166311 for
@RequiresOptIn
detector.For the following usage where
AnnotatedJavaClass
is annotated with an applicable annotation:A lint detector will receive a callback to
visitAnnotationUsage
for the constructor call; however, it will not receive a callback for the variable declaration on the preceding line.There's possibly an argument to be made for the usage of
obj
on the LHS of the assignment with the constructor, as well. The Kotlin compiler will raise three warnings in its own implementation of@RequiresOptIn
detection: the declaration ofobj
, the reference on the LHS of the assignment, and the constructor call on the RHS of the assignment.