Databinding fails with NoSuchMethodError

After updating to gradle 2.10 every time when I try to assemble debug build of the app I get the NoSuchMethodError exception. Here is the relevant part of the build log:

java.lang.RuntimeException: failure, see logs for details.
  cannot generate view binders java.lang.NoSuchMethodError:;)Z
    at android.databinding.tool.util.StringUtils.capitalize(
    at android.databinding.tool.util.ParserHelper.toClassName(
    at android.databinding.tool.CompilerChef.pushClassesToAnalyzer(
    at android.databinding.tool.CompilerChef.createChef(
    at android.databinding.annotationprocessor.ProcessExpressions.writeResourceBundle(
    at android.databinding.annotationprocessor.ProcessExpressions.onHandleStep(
    at android.databinding.annotationprocessor.ProcessDataBinding$ProcessingStep.runStep(
    at android.databinding.annotationprocessor.ProcessDataBinding$ProcessingStep.access$000(
    at android.databinding.annotationprocessor.ProcessDataBinding.process(

As you can see Method can’t be found.

  • How can i simulate accelerometer in android emulator?
  • Can't change drawer icon for NavigationDrawer
  • Glide. Cache to External Storage (SD card)
  • Do Android proxy settings apply to all apps on the device?
  • Override back button to act like home button
  • Android load from URL to Bitmap
  • Some specifics

    I use Retrolambda 3.2.5 and Java 8. There are no other extra plugins.

    Build plugin version:

    Build tools version: 23.0.3

    OS: OS X

    build.gradle looks like this. I altered it slightly to not expose some private stuff, but problem is still there.

    buildscript {
        repositories {
        dependencies {
            classpath ''
            classpath 'me.tatarka:gradle-retrolambda:3.2.3'
    apply plugin: ''
    apply plugin: 'me.tatarka.retrolambda'
    project.version = '1.0.0'
    afterEvaluate {
        tasks.matching {
        }.each { dx ->
            if (dx.additionalParameters == null) {
                dx.additionalParameters = []
            dx.additionalParameters += "--set-max-idx-number=50000" //    default 60000
    def googleApiKey = "key goes here"
    def appVersionCode = 1
    def appVersionName = project.version + "." + appVersionCode
    android {
        compileSdkVersion 23
        buildToolsVersion "23.0.3"
        defaultConfig {
            minSdkVersion 15
            targetSdkVersion 23
            manifestPlaceholders = [googleApiKey  : googleApiKey,
                                    appVersionCode: appVersionCode,
                                    appVersionName: appVersionName]
            multiDexEnabled true
            ndk {
                abiFilters "armeabi", "armeabi-v7a"
        buildTypes {
            release {
                minifyEnabled true
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard.cfg'
                applicationVariants.all { variant ->
                    variant.outputs.each { output ->
                        output.outputFile = new File(
            compileOptions {
                sourceCompatibility JavaVersion.VERSION_1_8
                targetCompatibility JavaVersion.VERSION_1_8
        flavorDimensions "multidex", "leakcanary"
        productFlavors {
            withLeakCanary {
                dimension "leakcanary"
            withoutLeakCanary {
                dimension "leakcanary"
            develDex {
                dimension "multidex"
                minSdkVersion 21
                targetSdkVersion 23
            prodDex {
                dimension "multidex"
                minSdkVersion 15
                targetSdkVersion 23
        packagingOptions {
            exclude 'META-INF/LICENSE.txt'
            exclude 'META-INF/LICENSE'
            exclude 'META-INF/NOTICE.txt'
            exclude 'META-INF/NOTICE'
            exclude 'META-INF/DEPENDENCIES'
        lintOptions {
            abortOnError false
        sourceSets {
            main {
                jniLibs.srcDir 'build/jniLibs'
        dexOptions {
            javaMaxHeapSize "4g"
        dataBinding {
            enabled = true
    task copyNativeLibs(type: Copy) {
        from(new File(buildDir, 'intermediates/exploded-aar/')) {
            include '**/*.so'
            exclude '**/'
        into new File(buildDir, 'jniLibs')
        eachFile { details ->
            def pathSplit = details.path.split('/')
            details.path = pathSplit[pathSplit.length - 2] + '/' +    pathSplit[pathSplit.length - 1]
        includeEmptyDirs = false
    tasks.withType(JavaCompile) { javaCompileTask ->    javaCompileTask.dependsOn copyNativeLibs }
    clean.dependsOn 'cleanCopyNativeLibs'
    dependencies {
        testCompile 'junit:junit:4.11'
        testCompile 'org.robolectric:robolectric:3.0'
        testCompile 'org.robolectric:shadows-multidex:3.0'
        testCompile('org.robolectric:shadows-httpclient:3.0') {
            exclude module: 'httpcore'
            exclude module: 'commons-codec'
        testCompile 'org.powermock:powermock-module-junit4:1.5.2'
        testCompile 'org.powermock:powermock-api-mockito:1.5.2'
        testCompile 'org.roboguice:roboguice:3.0.1'
        compile 'com.parse.bolts:bolts-android:1.2.1'
        compile fileTree(dir: 'libs', include: 'Parse-*.jar')
        compile ''
        compile 'com.squareup.retrofit:retrofit:1.9.0'
        compile ''
        compile ''
        compile ''
        compile ''
        compile ''
        compile ''
        compile 'org.roboguice:roboguice:3.0.1'
        provided 'org.roboguice:roboblender:3.0.1'
        compile('') {
            exclude group: '', module: 'guice'
        compile 'commons-io:commons-io:2.4'
        compile 'commons-lang:commons-lang:2.6'
        compile 'com.intellij:annotations:12.0'
        compile ''
        compile ''
        compile ''
        compile ''
        compile ''
        compile ''
        compile ''
        compile 'com.googlecode.libphonenumber:libphonenumber:7.0.7'
        withLeakCanaryCompile 'com.squareup.leakcanary:leakcanary-android:1.3.1'
        compile ''
        compile 'io.reactivex:rxandroid:1.0.1'
        compile 'io.reactivex:rxjava:1.0.14'


    Did anyone else had the same problem? How to fix it? If you need some extra information, please let me know in comments.

  • Android ProgessBar while loading WebView
  • Android: Listview shows wrong images while scrolling
  • Android Studio run configuration for ORMLite config generation
  • Different font sizes for different screen sizes
  • Multiple calls to AlarmManager.setRepeating deliver the same Intent/PendingIntent extra values, but I supplied different ones
  • How to quit a full screen web app
  • 2 Solutions collect form web for “Databinding fails with NoSuchMethodError”

    Have you tried the new patch on jitpack of simular issue #134 clean-build, there seemed to be something wrong with gradle import ordering you can try it with :

    repositories {
        maven { url "" }
    dependencies {
        classpath 'com.github.denis-itskovich:gradle-retrolambda:3.2.3-fix-134'

    It looks like there is an error with a plugin after upgrading the Android Studio.

    If you go in : <Android Studio Dir>/plugins/android/lib/builder-model-x.x.x.jar you may find 2 .jars. Try to delete the old version .jar and keep the new one and also clean and rebuild the project.

    if the above does not work try this:

    Change the version of Objectify library in the build.gradle file of your backend to 4.0b to 5.0.3 or higher if it exists.

    This is may sound irrelevant but objectify 4.0b library has same classes with same package name which are present in appengine sdk like

    when you deploy the app backend the appengine classes are overridden by objectify classes and hence when you try to call some method it is throwing error.

    This is solved in objectify 5.0.+

    Hope it helps as it helped me solving this issue.

    Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.