Home > Net >  Unable to add Kotlin Android Extensions to my android studio
Unable to add Kotlin Android Extensions to my android studio

Time:09-28

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

CodePudding user response:

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.

CodePudding user response:

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:

    buildFeatures {
        viewBinding = true
    }

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

  • Related