The Kotlin Android Extensions plugin provides a set of additional functionality for working with Kotlin and Android. The two biggest examples of this are as follows:
- Referencing Android views without findViewById()
- Generating Parcelable implementations
To enable these features, we must enable the experimental features within the androidExtensions block of ourĀ app/build.gradle.kts file. The following code snippet demonstrates how to do this:
androidExtensions {
isExperimental = true
}
Once this configuration is added to our build.gradle.kts file, the features included with the Android Extensions plugin will be enabled. In the next section, we'll explore one of those features to help with building our Android views.