我是Gradle和Kotlin的新手
当我使用gradle build
构建语法错误文件时
这只是显示
Execution failed for task ':compileKotlin'.
> Compilation error. See log for more details
如何获得类似
kotlinc
的行语法错误?PS:使用vscode,所以我需要它
已编辑
抱歉,我错过了错误消息,因为ojit_code和
gradle
之间存在差异gradle:
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
...
kotlinc:
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
最佳答案
这是一个已知问题,有人通过卸载所有Java版本并仅安装JDK 8来解决。
编辑:也检查此链接:https://github.com/waicool20/KAGA/issues/27
祝你今天愉快。
关于gradle - 没有更多关于 ':compileKotlin'的详细信息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46250162/