ARTICLE DETAIL

资讯详情

深耕网站建设、视觉设计与SEO优化的一线实战洞察。

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

关于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 版本

返回列表