Retrolambda: Lint crashes when using lambda expressions with retrolambda

You can use a special lombok version with lint which does not whine about Java 8 features.

buildscript {
    repositories {
        jcenter()
        ...
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:<version>'
        classpath 'me.tatarka:gradle-retrolambda:<version>'
        classpath 'me.tatarka.retrolambda.projectlombok:lombok.ast:0.2.3.a2'
    }

    // Exclude the version that the android plugin depends on.
    configurations.classpath.exclude group: 'com.android.tools.external.lombok'
}

This way you can keep running lint on the whole project, even with the latest versions of the Android Gradle plugin.

Note: If you receive same errors, try to put the configuration above into the top most build.gradle file. It should work then.

Leave a Comment