小编com*_*rro的帖子

Kotlin:'Int'类型的表达式'长度'不能作为函数调用.找不到函数'invoke()'

我正在尝试解决一个旧的kotlin项目中的问题.但问题是我无法编译代码.我尝试在Android Studio和IntelliJ中编译和运行.我有同样的错误.

以下是错误:

Error:(174, 25) Expression 'length' of type 'Int' cannot be invoked as a function. The function 'invoke()' is not found

Error:(176, 60) Unresolved reference: charAt

Error:(148, 67) Expression 'size' of type 'Int' cannot be invoked as a function. The function 'invoke()' is not found

Error:(107, 76) Expression 'ordinal' of type 'Int' cannot be invoked as a function. The function 'invoke()' is not found
Run Code Online (Sandbox Code Playgroud)

我的gradle脚本:

buildscript {
ext.kotlin_version = '1.0.4'

repositories {
    jcenter()
}
dependencies {
    classpath 'com.android.tools.build:gradle:1.5.0'
    classpath …
Run Code Online (Sandbox Code Playgroud)

kotlin

9
推荐指数
2
解决办法
1万
查看次数

标签 统计

kotlin ×1