错误:Android中的(1,0)android / databinding / tool / DataBindingBuilder

时间:2017-10-30 06:16:09

标签: android android-studio android-studio-3.0

我的代码在Android Studio 2.3版中运行良好,我确实更新到新的和最新版本3.0并开始在工作代码上出错:

  

错误:(1,0)android / databinding / tool / DataBindingBuilder

这是应用级build.gradle

apply plugin: 'com.android.application'

android {
compileSdkVersion 26
buildToolsVersion "26.0.1"
defaultConfig {
    applicationId "com.webapp"
    minSdkVersion 15
    targetSdkVersion 26
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
dataBinding {
    enabled = true
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
    exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:26.+'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
}

任何人都可以帮我解决这个问题。

1 个答案:

答案 0 :(得分:0)

我发布此答案,因为它对我有用,可能对其他人有帮助,更新项目级构建gradle类路径从较旧到最新构建gradle最新版本,即2.3.3 to 3.0.0从我的工作和DataBindingBuilder错误获取已解决

项目级别build.gradle

buildscript {
repositories {
    jcenter()
}
dependencies {
 //   classpath 'com.android.tools.build:gradle:2.3.3' compiling code with older gradle version in updated/latest gradle version shows DataBindingBuilder error
    classpath 'com.android.tools.build:gradle:3.0.0'

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}
}