gradle - 没有更多关于 ':compileKotlin'的详细信息

标签 gradle kotlinc

我是Gradle和Kotlin的新手

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

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

如何获得类似kotlinc的行语法错误?

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

已编辑

抱歉,我错过了错误消息,因为o​​jit_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/

相关文章:

java - 注解处理: how to change annotation target in Kotlin code?

debugging - Gradle/IntelliJ 沟通不畅导致 "Unable to start daemon process"

kotlin - kotlin REPL 有代码补全吗?

android - 无法获取未知属性 'bundleReleaseAar' Maven发布

java - 使用 Gradle 构建错误 "the number of constructors during runtime and compile time for org.gradlefx.configuration "

java - Kotlin 编译器或 Java 反编译器的奇怪行为

java - 在 Kotlin 中声明常量的所有方式之间的性能差异是什么?

kotlin - 在 kotlinc 的 jar 输出中包含反射库

java - Azure Functions, "System.Private.CoreLib: Value cannot be null. (Parameter ' 路径 1'). Value cannot be null. (Parameter ' 提供商')"

java - 使用Guava类时出现NoClassDefFoundError,即使Graava包含在Gradle构建文件和类路径中也是如此