Reputation: 257
After updating android studio to 3.4, am facing issues with lombok plugin. Though inside model class, annotations are recognised and showing properly, in activity all getter and setter functions i have used, are not recognised. I can build project as well, but in all activities all getter and setter functions are showing in red color. Any help is much appreciated.
I tried enabling annotation processor for android-studio. I am using lombok as dependency as given in the website, with annotation processor. Gradle version is 3.4.0.
Upvotes: 3
Views: 6961
Reputation: 5240
I had similar issue with Android Studio 3.6.1.
Lombok
compileOnly "org.projectlombok:lombok:1.18.12"
testCompileOnly "org.projectlombok:lombok:1.18.12"
kapt 'org.projectlombok:lombok:1.18.12'
annotationProcessor 'org.projectlombok:lombok:1.18.12'
This combination worked for me:
dependencies {
classpath 'com.android.tools.build:gradle:3.5.3'
This not:
classpath 'com.android.tools.build:gradle:3.6.1'
Upvotes: 1
Reputation: 157
If annotation processor is already enabled (Configure - Settings - Build, Execution, Deployment - Compiler - Annotation Processors - Enable annotation processing) and even after restarting the system, lombok doesn't work, then just uninstall lombok plugin, re-install it and restart the android ide.
UnInstall: File --> Settings --> Plugins --> Installed --> select Lombok --> Select uninstall from drop down (top right corner)
Install: File --> Settings --> Plugins --> Marketplace --> serach Lombok --> click install --> restart android IDE
Upvotes: 1
Reputation: 2302
Enable Annotation Processing in Android Studio 3.4
1. Android Studio - File - Close Project
2. Configure - Settings - Build, Execution, Deployment - Compiler - Annotation Processors - Enable annotation processing.
Upvotes: 7
Reputation: 257
For me, i didn't install the plugin. That's why i think android studio was not able to recognise annotations but i was able to build the project. I end up putting dependency in gradle file and installing the plugin through settings and now everything is working!
Upvotes: 3