问题
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
- In the IDE everything looks normal: no red squiggly underline asking Dog to implement getToys.
- When I run the code, Gradle complains that the Dog should implement getToys.
- 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