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

2023-12-13 20:41:16

报错如下: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 版本

文章来源:https://blog.csdn.net/u013075460/article/details/134861822
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。