Hey everyone how do we enable databinding in android_plugin_version = '3.4.0' ? as my android studio I install the latest version and I receive another error when downgrading the android_plugin_version = '3.4.0' to 3.2.xx.
Project gradle
buildscript {
ext {
kotlin_version = '1.3.31'
android_plugin_version = '3.4.0'
}
repositories {
google()
jcenter()
maven { url 'https://maven.google.com' }
}
dependencies {
classpath "com.android.tools.build:gradle:$android_plugin_version"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
allprojects {
repositories {
google()
jcenter()
mavenCentral()
}
}
Module
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
android {
compileSdkVersion 28
defaultConfig {
applicationId "xxx.xxx.com"
minSdkVersion 21
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner
"android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
dataBinding {
enabled = true
}
kapt {
generateStubs = true
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
kapt "com.android.databinding:compiler:$android_plugin_version"
}
Syncing has no problem but when running it, I received this error
Could not find com.android.databinding:compiler:3.4.0.
Searched in the following locations:
-
https://dl.google.com/dl/android/maven2/com/android/databinding/compiler/3.4.0/compiler-3.4.0.pom - https://dl.google.com/dl/android/maven2/com/android/databinding/compiler/3.4.0/compiler-3.4.0.jar - https://jcenter.bintray.com/com/android/databinding/compiler/3.4.0/compiler-3.4.0.pom - https://jcenter.bintray.com/com/android/databinding/compiler/3.4.0/compiler-3.4.0.jar - https://repo.maven.apache.org/maven2/com/android/databinding/compiler/3.4.0/compiler-3.4.0.pom - https://repo.maven.apache.org/maven2/com/android/databinding/compiler/3.4.0/compiler-3.4.0.jar