'kotlin android gradle error id 'kotlin-android-extensions'
plugins {
id 'com.android.application'
id 'kotlin -android'
id 'kotlin-android-extensions'
}
After updating the build.gradle file, it changed as below.
id 'kotlin-android-extensions' How do I add extensions as above?
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
}
Solution 1:[1]
Kotlin android extensions plugin is used for synthetic(to access view id from xml)
Android has deprecated this plugin. you need to start using Viewbinding.
add below line in your app build.gradle and remove all the synthetic imports and replace it with the binding class generated.
android { ... buildFeatures { viewBinding true } }
Solution 2:[2]
I think you just have added an extra white space by accident
plugins {
id 'com.android.application'
id 'kotlin -android'
id 'kotlin-android-extensions'
}
just remove that to
plugins {
id 'com.android.application'
id 'kotlin-android'
id 'kotlin-android-extensions'
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Ankit |
| Solution 2 | Pawan Roy |
