AllArgsConstructor from lombok is not found by Android Studio

后端 未结 6 1212
猫巷女王i
猫巷女王i 2020-12-09 16:50

When I create a new Java class with one or more field and attach the @AllArgsConstructor annotation from lombok to it, then i get this message

Err

6条回答
  •  爱一瞬间的悲伤
    2020-12-09 17:08

    Lombok generates the @ConstructorProperties by default for all generated constructors. On Android, that annotation is not available. As mentioned in the documentation it is possible to suppress the generation by either specifying suppressConstructorProperties=true for each @XxxArgsConstructor, or by using the following line in a high level lombok.config file:

    lombok.anyConstructor.suppressConstructorProperties = true
    

    Disclosure: I am a Lombok developer

提交回复
热议问题