完美解决None of the following candidates is applicable because of receiver type mismatch:

在这里插入图片描述

最近遇到一个错误,记录一下,网上搜索发现其他网友说可能是Kotlin版本问题,尝试升级Kotlin和降低Kotlin版本试试,下面是我遇到的情况。

错误日志

Unresolved reference. None of the following candidates is applicable because of receiver type mismatch:
public val Char.code: Int defined in kotlin

翻译:
**由于接收器类型不匹配,以下候选项均不适用:
public val Char.code:在kotlin中定义的Int**

出现错误位置:
在这里插入图片描述

解决方法
1、点击Build下的Clean Project ,运行测试
2、若是1步骤不成功,则点击Build下的Rebuild Project,再次运行测试,这次OK的

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/L_201607/article/details/129365645