Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot locate tasks that match ':composeApp:compileJava' as task 'compileJava' is ambiguous in project ':composeApp'

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 189ms

I have created the project from the jetbrains website.

like image 544
Devendra Singh Avatar asked Mar 03 '26 10:03

Devendra Singh


2 Answers

It looks like a bug in the template. According to Multiplatform: Cannot locate tasks that match ':composeApp:compileJava', calling gradle :composeApp:run from Run Anything works on my machine.

like image 52
Dewey Reed Avatar answered Mar 05 '26 17:03

Dewey Reed


In Mac, run the following command:

./gradlew :composeApp:run

For Windows, it's similar:

.\gradlew :composeApp:run

If it doesn't work on Windows, try running the Mac command in a bash terminal or with WSL.

like image 35
jaendevp Avatar answered Mar 05 '26 18:03

jaendevp