0

我是 gradle 和 kotlin 的新手

当我使用它构建语法错误文件时,gradle build 它只是显示

Execution failed for task ':compileKotlin'.
> Compilation error. See log for more details

我如何得到哪一行语法错误喜欢使用kotlinc

PS:使用vscode,所以我需要它


已编辑

gradle抱歉,我错过了错误消息,因为和之间的区别kotlinc

毕业典礼:

PS C:\PlayGround2> gradle build
e: C:\PlayGround2\src\main\kotlin\Main.kt: (26, 1): Expecting a top level declaration

> Task :compileKotlin
Using kotlin incremental compilation
...

科特林克:

PS C:\PlayGround2\src\main\kotlin> kotlinc .\Main.kt
Main.kt:26:1: error: expecting a top level declaration
}       <--- this line not shown in kotlinc
4

1 回答 1

0

这是一个已知问题,有人通过卸载所有 java 版本并仅安装 JDK 8 来解决它。

编辑:也检查这个链接:https ://github.com/waicool20/KAGA/issues/27

祝你今天过得愉快。

于 2017-09-16T04:57:59.027 回答