I'm using Lombok version 1.16.12, Android Studio 2.3 Beta 3, Android Plugin version 2.2.3, and Gradle 3.3. Most of the Lombok annotation work pretty well with my set up. But I'm running into issues with @AllArgsConstructor
and @RequiredArgsConstructor
. Here's some code:
@AllArgsConstructor
public class Sample{
private final String mName;
private final int mId;
}
Android Studio can detect the generated constructor, the editor lets me do:
new Sample("string",1234)
But when I run the project, I get Gradle build error:
error: variable mName might not have been initialized
So far I tried out this solution and the solution mentionedhere with no avail. What is the right way to use these annotations? Has anyone got it to work properly in Android? If so, what are your Gradle settings for Lombok?