English 中文(简体)
Kotlin Multiplatform, desktop 主要不能执行
原标题:Kotlin Multiplatform, desktopMain cannot be executed

我只是试图用KOtlin Multiplatform测试Hello World。 我这样做,就像有人说的。 我可以操作安乐器,可以工作,但当我试图管理台式主机时,我会收到这个错误的信息。

   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

i 还已经尝试了<条码>梯度:composeApp:run或格勒布任务,但是,我还是收到这一错误信息:

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
问题回答

我先向使用视窗的每个人伸出援手。 在我刚在终点站写过这一指令之前,就发出错误信息。

Now I wrote the command gradle :composeApp:run in Run Anything (opens with 2*strg) and it works.

Since gradle wasn t setup for me in windows (for android studio as default), it may be quicker/simpler to use:

.gradlew :composeApp:run

(项目目录中的roid室终端)

在“Windows 11”项目上,我遇到了同样的问题。

“在座的影像描述”/</a

Execute from PowerShell in the root path of the project the command

.gradlew :composeApp:run

enter image description here

为了更好地从Series处执行,梯度的“Edit Configuration”,并确定指挥“composeApp:run”和新配置的名称。

enter image description here enter image description here

I hope my answer has been helpful





相关问题
Exposed runs query on all HikariCP open connections

I m running a Ktor server with a PostgreSQL database and just set up the JetBrains Exposed ORM framework with HikariCP for connection pooling (per the recommendation in the Ktor documentation). My ...

SQLite Kotlin issue - no database

I am trying to create boardgamegeek APIs based app in AndroidStudio, however from unknown reason I m getting my database created with no columns. Here s Logical log: (1) no such table: games in "...

Flutter App cannot be installed on Android TV

I m building a Flutter app that should support Android TV and Mobile devices. Despite Google Play shows that it is supported, I cannot install app on my MiBox device. While trying to install it, both ...