Lombok Requires Annotation Processing

前端 未结 10 969
不思量自难忘°
不思量自难忘° 2020-12-16 09:04

I\'m using Android Studio 2.2 Preview 7, and the Lombok plugin suddenly started saying: Annotation processing seems to be disabled for the project X, and provid

10条回答
  •  感动是毒
    2020-12-16 09:51

    Probably marked answer was sufficient at the time but I struggled a bit with android studio 3 and lombok 1.16.18. Anyway following worked for me

    in app > build.gradle add following

    compileOnly 'org.projectlombok:lombok:1.16.18'
    annotationProcessor 'org.projectlombok:lombok:1.16.18'
    

    you may start getting other errors so if you in your MyApplication > lombok.config add following lines

    lombok.addGeneratedAnnotation = false
    lombok.anyConstructor.suppressConstructorProperties = true
    

    if you don't have lombok.config just added it

    Above were suggested by the developer of lombok in following posts
    addGeneratedAnnotation
    suppressConstructorProperties

提交回复
热议问题