0

I am trying to add databinding to my app. But the error I am getting after I enable databinding is this: No signature of method: build_9rfemhg4a5yc2kwb7aemx3270.android() is applicable for argument types: (build_9rfemhg4a5yc2kwb7aemx3270$_run_closure1) values: [build_9rfemhg4a5yc2kwb7aemx3270$_run_closure1@6e3b0699]

The part that causes the error is:

databinding {
   enabled = true
}

Removing this part causes the gradle to build properly. But that way I can't add databinding.

the build gradle is :

plugins {
   id 'com.android.application'
   id 'kotlin-android'
}

android {
   compileSdkVersion 30
   buildToolsVersion "30.0.2"

   defaultConfig {
       applicationId "com.example.aboutme"
       minSdkVersion 19
       targetSdkVersion 30
       versionCode 1
       versionName "1.0"

       testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
   }

   buildTypes {
       release {
           minifyEnabled false
           proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-      rules.pro'
       }
   }
   databinding {
      enabled = true
   }
   compileOptions {
       sourceCompatibility JavaVersion.VERSION_1_8
       targetCompatibility JavaVersion.VERSION_1_8
   }
   kotlinOptions {
       jvmTarget = '1.8'
   }
}

dependencies {

   implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
   implementation 'androidx.core:core-ktx:1.3.2'
   implementation 'androidx.appcompat:appcompat:1.2.0'
   implementation 'com.google.android.material:material:1.1.0'
   implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
   testImplementation 'junit:junit:4.+'
   androidTestImplementation 'androidx.test.ext:junit:1.1.2'
   androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
}

1 Answer 1

2

Found the answer. data'B'inding not data'b'inding

dataBinding {
  enabled = true
}
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.