How to use lombok plugin in Android Studio?

Sumit T picture Sumit T · Jun 23, 2016 · Viewed 18.2k times · Source

I installed lombok from 'Preferences -> Plugin', but it's not working when I am trying to generate Getter & Setter. My code doesn't recognize it.

Is there anyone having idea how to setup lombok and use it to generate getter & setter annotation?

Answer

Yurets picture Yurets · Jan 31, 2017

You need not only to install Lombok Plugin, but also add dependency to build.gradle:

dependencies{
    compileOnly 'org.projectlombok:lombok:1.18.12'
    annotationProcessor 'org.projectlombok:lombok:1.18.12' //or v. 1.16.2 in your case.
}

More info on official guide.

Another answer with instructions.