3

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?

Community
  • 1
  • 1
NullPointer
  • 496
  • 6
  • 14
  • I have no problem compiling and using the code above in Android Studio 3.1.3 and Lombok 1.18.2 (latest versions at the time this comment added). – Istvan Sep 03 '18 at 14:49

0 Answers0