I want to use Lombok in one of my projects in android studio 3.0 and I have problems with it. Annotations work fine and they don't have any errors. Here are my Gradle dependencies which I added Lombok in it.
compileOnly "org.projectlombok:lombok:1.16.18"
annotationProcessor "org.projectlombok:lombok:1.16.18"
I have a problem with Annotation Processors
too.
I have followed these steps:
- in
file>other settings>default settings
i have enabled theAnnotation Processors
- I have
Invalidate Caches / Restart
- in the
project settings
suddenly theAnnotation Processors
settings appeared under theBuild, Execution, Deployment>Compiler
menu which it was not there beforeInvalidating Cache
and I check its tick. - I have installed the Lombok plugin
when the Android Studio restarts the Annotation Processors
setting is gone but the plugin doesn't show any errors.
After doing all this still it doesn't work.
import com.google.gson.annotations.SerializedName;
import lombok.Getter;
class UserModel {
@SerializedName("uid")
@Getter private String userId;
}
this is how I defined my model and cant get the getUserId out of it.