I have a simple annotation in my processor like following:
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Target(ElementType.TYPE) @Retention(RetentionPolicy.CLASS)
public @interface BundleBuilder
{
// ...
}
This works in java files but as soon as I convert my file to kotlin, the import of the annotation is not working anymore. Why?
What do I need to change to get his annotation working in kotlin as well? From the docs I can see that kotlin is 100% compatible with java annotations so I'm a little bit confused here what's the problem... I would understand if the processor is not working and needs to be adjusted to work with kotlin, but I don't know why the import itself does not work...
The library I'm talking about is here: https://github.com/MFlisar/BundleArgs
I think you should use
kapt
for annotation processing in yourbuild.gradle
. After all, clean and rebuild your project so.