Gradle没有更多的细节’:compileKotlin’
我是gradle和kotlin的新手
当我建立语法错误文件使用gradle build
它只是显示
Execution failed for task ':compileKotlin'. > Compilation error. See log for more details
我如何得到像使用kotlinc
哪一行的语法错误?
PS:使用vscode,所以我需要它
编辑
对不起,我错过了错误信息,因为gradle
和kotlinc
不同
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生命周期插件时声明自定义的“干净”任务是不允许的
- 使用Gradle在Kotlin服务器和客户端项目之间共享代码
- 使用Kotlin和Java编译器的Android项目需要很长时间才能编译 – 超过20分钟
- kotlin-kapt插件不使用“kapt.generateStubs”
- Kotlin Dagger2找不到符号ApplicationModule_ProvideApplicationFactory
- 将Kotlin下载到Android Studio时出现与证书相关的错误
- 执行任务’:app:compileDebugKotlin’失败。 >内部编译器错误。 查看日志了解更多详情
- 无法使Coverity Scan工作(Windows和Travis上的Java / Kotlin / Gradle 3.3)
- gradle multi-project:构建目录出现在包含Kotlin artefact的根目录中