第一种:
这种方式适用于classpath 'com.android.tools.build:gradle:1.5.0'
android { | |
compileSdkVersion 23 | |
buildToolsVersion "23.0.1" | |
dataBinding { | |
enabled = true | |
} | }...... |
第二种:
新建一个project,在dependencies中添加以下依赖
dependencies {
classpath "com.android.tools.build:gradle:1.3.0"
classpath "com.android.databinding:dataBinder:1.0-rc1"
}
在需要使用支持库的module 的build.gradle文件中添加插件申请:
apply plugin: 'com.android.application'
apply plugin: 'com.android.databinding'