Kotlin多平台,无法执行desktopMain

mgdq6dx1  于 6个月前  发布在  Kotlin
关注(0)|答案(1)|浏览(126)

我只是想用Kotlin多平台测试一个HelloWorld。我按照向导的描述做了。我可以运行Android应用程序,它可以工作,但是当我尝试运行桌面主程序时,我得到了这个错误消息。

Cannot locate tasks that match ':composeApp:compileJava' as task 'compileJava' is ambiguous in project ':composeApp'. Candidates are: 'compileDebugAndroidTestJavaWithJavac', 'compileDebugJavaWithJavac', 'compileDebugUnitTestJavaWithJavac', 'compileReleaseJavaWithJavac', 'compileReleaseUnitTestJavaWithJavac'.
* Try:
> Run gradle tasks to get a list of available tasks.
> For more on name expansion, please refer to https://docs.gradle.org/8.4/userguide/command_line_interface.html#sec:name_abbreviation in the Gradle documentation.
> 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.
Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
For more on this, please refer to https://docs.gradle.org/8.4/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.
BUILD FAILED in 883ms

字符串
我也试过gradle :composeApp:rungradlew tasks命令,但也不起作用,我得到这个错误消息:

gradlew : The name "gradlew" was not recognized as the name of a cmdlet, a function, a script file or an executable program. Check the spelling of the 
name, or whether the path is correct (if included), and repeat the process.
In line:1 Character:1
+ gradlew tasks
+ ~~~~~~~
    + CategoryInfo : ObjectNotFound: (gradlew:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

wljmcqd8

wljmcqd81#

我已经为每个使用Windows的人准备好了。在我简单地在终端中编写这个命令并得到错误消息之前。

现在我在Run Anything(以2*strg打开)中编写了gradle :composeApp:run命令,它可以工作。

相关问题