我刚刚在Android Studio 3.2 Canary 16上创建了一个新项目,启用了Kotlin.然后我也启用了数据绑定,但是我收到一条错误,说它无法找到DataBindingComponent类.
这是我的项目gradle:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.2.41'
ext.android_plugin_version = '3.2.0-alpha10'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.0-alpha16'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Run Code Online (Sandbox Code Playgroud)
我的模块gradle文件:
apply plugin: 'com.android.application'
apply plugin: …
Run Code Online (Sandbox Code Playgroud)