I'm currently using Lombok with Android Studio 2.2.2 (same Gradle plugin version) and JDK 8 (Android Studio does not allow one to use JDK 7).
When using Lombok 1.16.0, everything is working. I'm using @Getter and @Builder and all is fine. But as soon as I upgrade to a newer version I get stuff like this:
Error:(44, 5) error: cannot find symbol class Generated
Error:(52, 5) error: cannot find symbol class Generated
Error:(60, 5) error: cannot find symbol class Generated
Error:(68, 5) error: cannot find symbol class Generated
These 4 lines contain the @Getter annotation.
I'm not sure if this is related to #971 or #1116 but I have a feeling it is.
This is actually not a problem with Lombok. It's just that Android does not include the @Generated annotation from the javax.annotation package.
I fixed this on my project by adding provided "javax.annotation:jsr250-api:1.0" to my application build.gradle file.
Most helpful comment
This is actually not a problem with Lombok. It's just that Android does not include the
@Generatedannotation from thejavax.annotationpackage.I fixed this on my project by adding
provided "javax.annotation:jsr250-api:1.0"to my applicationbuild.gradlefile.