Lombok: Annotations (@Getter, @Builder, etc) do not work on versions above 1.16.0

Created on 23 Nov 2016  路  1Comment  路  Source: projectlombok/lombok

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.

Most helpful comment

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.

>All comments

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.

Was this page helpful?
0 / 5 - 0 ratings