KTExtentions.java文件中执行main方法报错,是怎么回事儿?

来源:2-17 Kotlin扩展函数(一)

慕粉0917535913

2023-10-16 09:40

java代码如下:

KTExtentions {
    (String[] args) {
        KTExtensionsKt.(Jump())}
}

下面这个现象是正常的么?

报错如下:

9:35:22: Executing ':app:KTExtentions.main()'...


FAILURE: Build failed with an exception.

* Where:
Initialization script 'C:\Users\liu.xiaoqian\AppData\Local\Temp\KTExtentions_main__.gradle' line: 41

* What went wrong:
A problem occurred configuring project ':app'.
> Could not create task ':app:KTExtentions.main()'.
   > SourceSet with name 'main' not found.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 253ms
9:35:23: Execution finished ':app:KTExtentions.main()'.


写回答 关注

0回答

还没有人回答问题,可以看看其他问题

2021Android从零入门到实战(Kotlin版)

移动端大牛带你快速入门Android

18959 学习 · 74 问题

查看课程

相似问题