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

5

12
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.

Bamako answered 6/11, 2023 at 8:2 Comment(0)
C
31

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.

Columbine answered 7/11, 2023 at 6:45 Comment(1)
this works plus see how to get debugger attached here #77480998Dynamoelectric
N
5

If you are using Android Studio on Mac, from the terminal type: ./gradlew :composeApp:run

Neuritis answered 10/12, 2023 at 12:29 Comment(0)
S
5

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.

Subfamily answered 12/12, 2023 at 4:19 Comment(0)
D
2

I just ran into this issue on Android Studio and running the same project in IntelliJ Idea gave me no errors and the build ran fine.

Deferral answered 18/1, 2024 at 1:27 Comment(0)
P
0

Sync Project with Gradle Files worked for me

Phthisis answered 22/7, 2024 at 6:12 Comment(1)
As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.Shiftless

© 2022 - 2025 — McMap. All rights reserved.