hen i try to add kotlin-android-extensions via:
apply plugin: ‘kotlin-android-extensions’
to my project Android Studio tells me Plugin with ‘kotlin-android-extensions not found??
What is going wrong? I am Running Android Studio
hen i try to add kotlin-android-extensions via:
apply plugin: ‘kotlin-android-extensions’
to my project Android Studio tells me Plugin with ‘kotlin-android-extensions not found??
What is going wrong? I am Running Android Studio
3
Answers
Kotlin Android Extensions has been deprecated for two years and should not be used in new products.
As of Kotlin 1.8, it is not available at all anymore.
I don’t think they’ve officially turned it off yet, since Kotlin 1.8 hasn’t officially been released, so there is probably some config issue in your project’s Gradle files, but it doesn’t matter, because you should not rely on a plugin that is going to stop working within 3 months.
As "kotlin-android-extensions" is deprecated now, it’s better to use view binding.
just head to the module-level build.gradle and add inside the android block:
then you will be able to use binding variables to reference views from your activities and fragments, all you need is here, but if you have any additonal questions to viewBinding just leave a comment
It’s deprecated Base on the google document
for those who’s wonder what the
synthetic
is. I should say a simple way to access to UI view id with kotlin which was possible by adding'kotlin-android-extensions'
inGradle
.'kotlin-parcelize'
instead of'kotlin-android-extensions'
.you can add any of it like the following