Android DataBinding + Lombok

Issue #59 invalid
created an issue

I'm trying to build the project with lombok and binding, but get an error. How do I fix this?

I need to annotation lombok process before android data binding


/Users/jaboko/Development/ddg/intari/intati-picket-navigator/PicketNavigator/src/main/java/ru/ddgcorp/picketnavigator/core/Model/ error: package ru.ddgcorp.picketnavigator.databinding does not exist
import ru.ddgcorp.picketnavigator.databinding.LogoutDlgNewBinding;


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':PicketNavigator:compileX86DebugJavaWithJavac'.
> java.lang.RuntimeException: Found data binding errors.
  ****/ data binding error ****msg:Could not find accessor ru.ddgcorp.picketnavigator.core.utils.server.response.User.workerRole file:/Users/jaboko/Development/ddg/intari/intati-picket-navigator/PicketNavigator/src/main/res/layout/logout_dlg_new.xml loc:72:32 - 72:52 ****\ data binding error ****


    dependencies {
        classpath ''
        classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'


apply plugin: ''
apply plugin: ''

android {


    dataBinding {
        enabled = true

dependencies {

        compile fileTree(include: ['*.jar'], dir: 'libs')


        apt 'org.projectlombok:lombok:1.+'
        provided 'org.projectlombok:lombok:1.+'

User class

public class User {
    @Getter @Setter
    private WorkerRole workerRole;

Comments (3)

  1. Hugo Visser repo owner

    There's no reason why you should use both apt and provided for lombok, but that's probably not the reason why it's failing. From the error it seems that data binding is looking at your Java source class, while lombok is instrumenting the class files.

    I doubt this is a bug in android-apt but rather an incompatibility between lombok (which does funny things for an annotation processor) and databinding.

  2. Senthil S

    This bug still exists.

    Changed apt -> androidProcessor

    Feel, lambok is generating setters and getters little later but databinding is looking it way ahead.

  3. Log in to comment