hello everyone! My IntelliJ got updated today to version IntelliJ IDEA 2023.2 (Ultimate Edition) Bui...
r
hello everyone! My IntelliJ got updated today to version IntelliJ IDEA 2023.2 (Ultimate Edition) Build #IU-232.8660.185 and now I'm getting the following error when compiling a shared multiplatform lib (Jvm, Android, iOS) I'm working on: Cannot locate tasks that match 'sharedcompileJava' as task 'compileJava' is ambiguous in project ':shared'. Candidates are: 'compileDebugAndroidTestJavaWithJavac', 'compileDebugJavaWithJavac', 'compileDebugUnitTestJavaWithJavac', 'compileReleaseJavaWithJavac', 'compileReleaseUnitTestJavaWithJavac'. Never had any issues before this version. Any ideas how to fix it?
j
Are you using Build -> Build Project? This doesn't work to build multiplatform projects generally, as it's trying to build a Java project. You should be able to build with the
assemble
or
build
Gradle tasks.
💡 1
r
Yes, I've been using Build -> Build Project for the past... year? with no issue
do you know why this is suddenly an issue?
let me try with
assemble build
j
I've found it may or may not work, depending on the file you have open in the editor at the time.
r
same result with assemble or build
j
assemble
and
build
are each individual Gradle tasks. You can run them from the Gradle tasks menu on the right in the IDE or
./gradlew assemble
or
./gradlew build
from the terminal. The
build
task will run
assemble
as well as your tests.
r
it didn't work unfortunately
either way thanks for the tip
j
What's the error you're getting?
r
Cannot locate tasks that match 'sharedcompileJava' as task 'compileJava' is ambiguous in project ':shared'. Candidates are: 'compileDebugAndroidTestJavaWithJavac', 'compileDebugJavaWithJavac', 'compileDebugUnitTestJavaWithJavac', 'compileReleaseJavaWithJavac', 'compileReleaseUnitTestJavaWithJavac'.
j
That error doesn't line up with running
./gradlew assemble
.
r
that's compiling through Build -> Build Project
with
./gradlew assemble
I get this:
nevermind
I think I've found the issue
kotlin.mpp.androidSourceSetLayoutVersion=2
I've removed this line and now it works
I guess the new Idea comes with the newest plugin or something like that
everything seems to be working fine now
🎉 1
even the Build / Builde Project
thanks a lot!