Hey y’all. I’m trying to get into bytecode transfo...
# getting-started
Hey y’all. I’m trying to get into bytecode transformation with Kotlin, but my efforts are thwarted by an issue with annotation retention that I can’t seem to get past. In the attached image, you can see that I define a custom field annotation with binary retention on the left. I apply this annotation to some random fields of my sample class (middle), but it doesn’t make it into the actual class file (right). Changing retention and target of the annotation class have not done anything, and neither has trying to scope the annotation at the use site with
. For testing, I tried adding another third-party annotation to one of the fields and that one does end up in the class file, so I’m not sure what I’m doing wrong. Does anybody have a pointer regarding how to make my annotation show up in
? Thanks in advance.
Update: It seems like it was the target after all. For my specific usage, it must be
isn’t cutting it here.
can you please paste the code so i can try to help you
No need, I was able to resolve it already – but thank you nonetheless! The solution is to change
Copy code
annotation class Redacted
Copy code
annotation class Redacted
and it is put in the class file. 🙂