데이터바인딩 build.gradle 설정파일 - YChaeeun/aac GitHub Wiki

1) build.gradle (Module:app)

apply plugin: 'kotlin-kapt' // kotlin-android 보다 위에 놓기

android {
    dataBinding {
        enabled true
    }
}

dependencies {
    // dataBinding
    kapt "com.android.databinding:compiler:3.1.4"
}

전체 코드


apply plugin: 'com.android.application'

apply plugin: 'kotlin-kapt'

apply plugin: 'kotlin-android'

apply plugin: 'kotlin-android-extensions'


android {
    compileSdkVersion 29
    buildToolsVersion "29.0.2"
    defaultConfig {
        applicationId "com.nexters.aac"
        minSdkVersion 19
        targetSdkVersion 29
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }

    dataBinding {
        enabled true
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'androidx.core:core-ktx:1.1.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test.ext:junit:1.1.0'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'

    // dataBinding
    kapt "com.android.databinding:compiler:3.1.4"

}



이건 뭘까...

Build 할 때 뜬 노란색 경고 세모 너무 거슬린다

w: [kapt] Incremental annotation processing requested, but support is disabled because the following processors are not incremental: android.databinding.annotationprocessor.ProcessDataBinding (DYNAMIC).