I have this in my root build.gradle file:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'
}
}
and in the app build.gradle file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.company.app"
minSdkVersion 14
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:22.2.0'
//more third-party libraries
}
And this is my layout:
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<data>
<variable
name="user"
type="com.company.app.models.LoginCredentials"/>
</data>
<EditText
android:layout_width="match_parent"
android:layout_height="55dp"
android:text="@{user.username}"/>
<!-- More layouts and widgets -->
</layout>
But I get this error:
Error:(82, 35) No resource type specified (at 'text' with value '@{user.username}').
I have tried to put:
dataBinding {
enabled = true
}
but I get this another error:
Error:Could not find com.android.databinding:library:1.0-rc3.
How can I do? I have just updated Android Studio to v1.5.1.
compileSdkVersion 23 buildToolsVersion "23.0.1" & targetSdkVersion 23&compile 'com.android.support:appcompat-v7:23.1.0'dataBinding{ enabled = true }in theandroid { }section.dataBinding.enabled = trueand updated version to 23