Android Studio not playing well with Lombok

≯℡__Kan透↙ 提交于 2019-12-24 06:13:53

问题


I just upgraded to the latest Android Studio (2.1.1) and now it’s acting strange concerning Lombok. I have an arrangement such that class Dog implements interface IDog.

@Data
class Dog implements IDog{
  private final List<String> toys;
}

interface IDog{
  public List<String> getToys();
}

Before the upgrade to 2.1.1 I never had a complaint, but now here is what’s happening

  1. In the IDE everything looks normal: no red squiggly underline asking Dog to implement getToys.
  2. When I run the code, Gradle complains that the Dog should implement getToys.
  3. So to check if Lombok is just not there, I comment out @Data. As soon as I do the squiggly underline comes.

So it’s as if Android Studio understands that Lombok is handling the getter creation but Gradle does not see it. Has anyone found a solution to this?

来源:https://stackoverflow.com/questions/37426036/android-studio-not-playing-well-with-lombok

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!