I asked this in <#C6CU1NNBC|android-databinding>, ...
# android
r
I asked this in #android-databinding, any thoughts on what might be wrong?
t
Please share that common .gradle file, and the build.gradle for that library module
m
what version of the gradle plugin are you using? “buildFeatures” is a relatively recent addition.
r
Copy code
android {

    compileSdkVersion 30

    defaultConfig {
        minSdkVersion 23
        targetSdkVersion 30
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    kotlinOptions {
        jvmTarget = JavaVersion.VERSION_1_8.toString()
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt')
        }
    }

    lintOptions {
        lintConfig file("../lint.xml")
    }

    testOptions {
        animationsDisabled = true
        execution = "ANDROIDX_TEST_ORCHESTRATOR"
        unitTests.all {
            useJUnitPlatform()
            maxHeapSize "2048m"
            test {
                reports.junitXml.destination = file("$rootDir/reports/xml/$<http://project.name/%22|project.name/">)
                reports.html.destination = file("$rootDir/reports/html/$<http://project.name/%22|project.name/">)
            }

            // See tests results in the console when running via command line
            testLogging {
                events "started", "standard_out", "standard_error", "passed", "skipped", "failed"
            }
        }
    }
}

dependencies {
    testImplementation deps.kotlin.kotlinTest
    testImplementation deps.junit.core
    testImplementation deps.junit.jupiterApi
    testImplementation platform(deps.junit.bom)
    testRuntimeOnly deps.junit.jupiterEngine
    testRuntimeOnly deps.junit.vintageEngine // 'allows JUnit 3 and JUnit 4 tests to run'
}

// <https://github.com/airbnb/epoxy/releases/tag/4.0.0>
// Note: if parallel processing is unreliable, we can turn it off. still incubating.
project.android.buildTypes.all { buildType ->
    buildType.javaCompileOptions.annotationProcessorOptions.arguments =
            [
                    enableParallelEpoxyProcessing: "true"
            ]
}
common file ^
complete gradle file for the module that is failing
Copy code
buildscript {
    repositories {
        maven {
            // Virtual repository: <https://www.jfrog.com/confluence/display/JFROG/Virtual+Repositories>
            // contains mirrors of google, kotlin-bintray, jcenter, oss-sonatype, and internal libs
            url = uri("<https://plangrid.jfrog.io/artifactory/libs-release/>")
            credentials {
                username = System.getenv("ARTIFACTORY_USER")
                password = System.getenv("ARTIFACTORY_PASSWORD")
            }
        }
    }
    dependencies {
        classpath("com.jakewharton:butterknife-gradle-plugin:10.2.1")
    }
}

plugins {
    id("com.android.library")
    kotlin("android")
    kotlin("kapt")
    id("org.jetbrains.kotlin.android.extensions")
    id("androidx.navigation.safeargs.kotlin")
}

apply(from = "${rootDir}/AndroidCommon.gradle")
apply(plugin = "com.jakewharton.butterknife")

android {

    lintOptions {
        isWarningsAsErrors = true
        isAbortOnError = true
    }

    buildFeatures {
        viewBinding = true
    }

}

dependencies {
    implementation(project(":mvi"))
    implementation(project(":alloy"))
    implementation(project(":core"))
    implementation(project(":domain"))
    implementation(project(":views"))
    implementation(project(":io"))
    implementation(D.Android.appCompat)
    implementation(D.Android.constraintLayout)
    implementation(D.Android.ktx)
    implementation(D.Android.navigationFragment)
    implementation(D.Android.navigationUi)
    implementation(D.Kotlin.stdlibJdk8)
    implementation(D.RxJava.rxjava2)
    implementation(D.RxJava.rxbinding)
    implementation(D.RxJava.rxbindingAppcompat)
    implementation(D.RxJava.rxbinding2)
    implementation(D.RxJava.rxbinding3)
    implementation(D.RxJava.rxkotlin2)
    implementation(D.RxJava.rxrelay)
    implementation(D.Dagger.javaxInject)
    implementation(D.Logging.timber)
    implementation(D.Picasso.core)
    implementation(D.ThreeTen.androidDateTimeFormatters)

    implementation(D.Android.lifecycleExtensions)
    implementation(D.Android.lifecycleRuntime)
    implementation(D.Android.lifecycleViewModelSavedState)

    implementation(D.Butterknife.core)
    kapt(D.Butterknife.compiler)

    implementation(D.Dagger.core)
    kapt(D.Dagger.compiler)

    implementation(D.Pspdfkit)

    testImplementation(D.Junit.core)

    //Paging
    implementation(D.Android.Paging.core)
    implementation(D.Android.Paging.pagingRxJava)
    //Epoxy
    implementation(D.Epoxy.core)
    implementation(D.Epoxy.paging)
    kapt(D.Epoxy.processor)

    //barcode scanner
    implementation(D.MachineLearning.barcodeScanning)

    //CameraX
    implementation(D.Android.CameraX.cameraX)
    implementation(D.Android.CameraX.lifecycle)
    implementation(D.Android.CameraX.view)

    androidTestImplementation(D.Android.Test.junitExt)
    androidTestImplementation(D.Android.Espresso.core)
}
from the root build.gradle
Copy code
classpath 'com.android.tools.build:gradle:4.1.0'