Android使用kotlin开发,运行报错
The 'kotlin-android-extensions' Gradle plugin is no longer supported. Please use this migration guide (https://goo.gle/kotlin-android-extensions-deprecation) to start working with View Binding (https://developer.android.com/topic/libraries/view-binding) and the 'kotlin-parcelize' plugin.
出现这个提示是因为’kotlin-android-extensions’是android studio不赞成使用的。
app model下的build.gradle里面的id 'kotlin-android-extensions’删除
改成
buildFeatures {
viewBinding true
}
如下图
然后再sync now 同步一下就可以了