James Black
04/23/2022, 3:50 AMThe 'java' plugin has been applied, but it is not compatible with the Android plugins.
In my shared build.gradle I have this. If I just use jvm() instead no issues, except it goes to androidMain not jvmMain.
kotlin {
android()
jvm {
withJava()
}
I have a sinking feeling it won't be resolved any time soon based on this issue:
https://youtrack.jetbrains.com/issue/KT-30878
Is the best bet to just have web and server have one KMM project and android/iOS and everything else have the other, or should servers just not be in the KMM project currently?ephemient
04/23/2022, 11:42 PMkotlin { android() jvm() }
works as long as you avoid `kotlin.jvm.withJava()`; do you need it?James Black
04/23/2022, 11:45 PMephemient
04/23/2022, 11:46 PMJames Black
04/23/2022, 11:49 PMephemient
04/23/2022, 11:52 PMwithJava()
, it sounds like a dependency issue that is better resolved there rather than using withJava()
here as a workaroundandroid
and jvm.withJava()
work togetherJames Black
04/24/2022, 1:16 AMWrong shared subproject.
Due to this:
try {
val s = println(Platform().platform)
} catch(e:Throwable) { println("Wrong shared subproject.")}
It tries to execute this line:
actual val platform: String = "Android ${android.os.Build.VERSION.SDK_INT}"
ephemient
04/24/2022, 2:03 AMJames Black
04/24/2022, 6:17 AMval apiKey = "88888"//BuildKonfig.api_key
val weatherClientApiKey = BuildKonfig.weather_client_api_key
actual class Platform actual constructor() {
actual val platform: String = "Android "
}
So regardless, with or without the plugin it still goes to shared/androidMain, not jvmMain, with Kotlin 1.6.10 or 1.6.20.
Thanks for trying though. Guessing it will just be broken for the foreseeable future.