我的Android數據綁定庫存在問題。 我有一個新安裝的Android Studio v2.0和新創建的項目。 的問題是,當我嘗試Android DataBinding構建錯誤
dataBinding {
enabled = true
}
添加到我的build.gradle,我試圖建立項目得到這個錯誤: :應用:dataBindingProcessLayoutsDebug失敗 錯誤:執行失敗的任務「:應用程序:dataBindingProcessLayoutsDebug」。
Could not initialize class android.databinding.parser.XMLLexer
該文件的build.gradle是這樣的:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
和
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion '23.0.3'
defaultConfig {
applicationId "com.silgrid.test"
minSdkVersion 14
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dataBinding {
enabled = true
}
}
dependencies {
}
有誰知道如何解決這一問題? 謝謝。
承擔該職位的先決條件看http://code2concept.blogspot.in/2016/07/android-data-binding-part-1 .html – nitesh