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:
file>other settings>default settings
i have enabled the Annotation Processors
Invalidate Caches / Restart
project settings
suddenly the Annotation Processors
settings appeared under the Build, Execution, Deployment>Compiler
menu which it was not there before Invalidating Cache
and I check its tick.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.
Same issue for me. Android Studio 3.2 default config.
-Installed Lombok plugin
-Added the following to app dependencies
compileOnly 'org.projectlombok:lombok:1.18.4'
annotationProcessor 'org.projectlombok:lombok:1.18.4'
And Lombok annotations were just ignored. After restarting Android Studio I got the Event log saying Lombok requires annotation processing, but Preferences/ Build Exec.../Compiler didn't show anything under it.
File / Invalidate caches restart did the trick. After that I could see the annotation processors option.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With