一:None of the following candidat

2020-04-02  本文已影响0人  禄眠

错误日志

Unresolved reference. None of the following candidates is applicable because of receiver type mismatch:

出错代码

val update = flightConfigViewModel.updateFlightConfigName(name, configId, userId!!)
if (update > 0) {  // 就这行
    toast.showToast("修改成功")
} else {
    toast.showToast("修改失败")
}

解决办法

我这篇博客:解决kotlin中isNullOrEmpty错误

更新Kotlin版本

buildscript {
    ext.kotlin_version = '1.3.61'  // 最新版1.3.71
    repositories {
        google()
        jcenter()
        
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.6.2'
        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
    }
}

然后就好了

但是我又把版本退回去再试了下,居然也不报错了?!真是奇怪

上一篇下一篇

猜你喜欢

热点阅读