我在Android Studio 3.2.1上创建了一个新项目并启用了数据绑定,但是却收到一个错误消息,它找不到DataBindingComponent类。
我无法使用./gradlew assembleDebug
从命令行进行构建符号:类DataBindingComponent 位置:类ActivityMainBinding /home/project/newGradle/app/build/Generated/source/dataBinding/baseClasses/debug/com/demo/gradledemo/databinding/ActivityMainBinding.java:38:错误:找不到符号 @Nullable ViewGroup根,布尔值attachToRoot,@ Nullable DataBindingComponent组件){
符号:类DataBindingComponent 位置:类ActivityMainBinding /home/project/newGradle/app/build/generated/source/dataBinding/baseClasses/debug/com/demo/gradledemo/databinding/ActivityMainBinding.java:49:错误:找不到符号 @Nullable DataBindingComponent组件){
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.demo.gradledemo"
minSdkVersion 19
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner
"android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
}
debug{
debuggable true
}
}
dataBinding {
enabled = true
}
}