我想使用kotlin @Parcelize的特性,
我在 gradle 上应用了插件:'kotlin-android-extensions'
,我添加了
androidExtensions {
experimental = true
}
但错误继续出现。此错误消息:
Error:(28, 0) Could not find method androidExtensions() for arguments [build_8di01fmxa4d18k9q0yy3fdd20$_run_closure2@27f46852] on project ':app' of type org.gradle.api.Project.
<a href="openFile:F:\BELAJAR\ANDROID\AndroidStudioProjects\KADE\app\build.gradle">Open File</a>
最佳答案
- 使用最新版本的 Kotlin (>= v1.1.51)
- 在您的应用模块中使用最新版本的 Kotlin Android 扩展,
所以你的
build.gradle
可能看起来像:
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
android {
androidExtensions {
experimental = true
}
}
dependencies {
// ...
}
关于android - 找不到方法 androidExtensions(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52902720/