ARTICLE DETAIL

建站实战干货

来自一线的建站与推广经验沉淀,每一条都经过真实交付验证。

关于kotlin的属性委托报错的解决方案

2026/8/30 5:28:06 拓冰建站 浏览量
关于kotlin的属性委托报错的解决方案

报错如下:Property delegate must have a ‘getValue(SecurityCheckView, KProperty*>)’ method. None of the following functions are suitable

解决方案就是在:
`buildscript {
ext.kotlin_version = “1.3.72”
repositories {
google()
jcenter()
}
dependencies {
classpath “com.android.tools.build:gradle:4.1.1”
classpath “org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version”

    // NOTE: Do not place your application dependencies here; they belong// in the individual module build.gradle files
}

}

allprojects {
repositories {
google()
jcenter()
maven { url ‘https://jitpack.io’ }
}
// gradle.projectsEvaluated {
// tasks.withType(JavaCompile) {
// options.compilerArgs << “-Xlint:unchecked” << “-Xlint:deprecation”
// }
// }
}

task clean(type: Delete) {
delete rootProject.buildDir
}`

修改 kotlin-gradle-plugin 版本