czuckie
06/08/2023, 8:05 PMThe 'java' plugin has been applied, but it is not compatible with the Android plugins.
CRamsan
06/08/2023, 8:10 PMjava
plugin being applied by default in the mp project. Why do you need to apply the java
plugin?czuckie
06/08/2023, 8:11 PMCRamsan
06/08/2023, 8:11 PMczuckie
06/08/2023, 8:11 PMczuckie
06/08/2023, 8:11 PMCRamsan
06/08/2023, 8:12 PMjava
plugin.czuckie
06/08/2023, 8:13 PMczuckie
06/08/2023, 8:13 PMjw
06/08/2023, 8:13 PMjvm { withJava() }
or just jvm()
?czuckie
06/08/2023, 8:13 PMjvm {
jvmToolchain(11)
testRuns.named("test") {
executionTask.configure {
useJUnitPlatform()
}
}
}
czuckie
06/08/2023, 8:14 PMCRamsan
06/08/2023, 8:14 PMCRamsan
06/08/2023, 8:14 PMczuckie
06/08/2023, 8:15 PMczuckie
06/08/2023, 8:16 PMplugins {
kotlin("multiplatform") version "1.8.21"
application
id("com.android.application")
}
group = "from.wizard"
version = "1.0-SNAPSHOT"
repositories {
google()
mavenCentral()
maven("<https://maven.pkg.jetbrains.space/public/p/kotlinx-html/maven>")
}
kotlin {
jvm {
jvmToolchain(11)
testRuns.named("test") {
executionTask.configure {
useJUnitPlatform()
}
}
}
js {
binaries.executable()
browser {
commonWebpackConfig {
cssSupport {
enabled.set(true)
}
}
}
}
android()
sourceSets {
val commonMain by getting
val commonTest by getting {
dependencies {
implementation(kotlin("test"))
}
}
val jvmMain by getting {
dependencies {
implementation("io.ktor:ktor-server-netty:2.0.2")
implementation("io.ktor:ktor-server-html-builder-jvm:2.0.2")
implementation("org.jetbrains.kotlinx:kotlinx-html-jvm:0.7.2")
}
}
val jvmTest by getting
val jsMain by getting {
dependencies {
implementation("org.jetbrains.kotlin-wrappers:kotlin-react:18.2.0-pre.346")
implementation("org.jetbrains.kotlin-wrappers:kotlin-react-dom:18.2.0-pre.346")
implementation("org.jetbrains.kotlin-wrappers:kotlin-emotion:11.9.3-pre.346")
}
}
val jsTest by getting
val androidMain by getting
val androidTest by getting {
dependencies {
implementation("junit:junit:4.13.2")
}
}
}
}
android {
namespace = "from.wizard.application"
compileSdk = 32
defaultConfig {
applicationId = "from.wizard.application"
minSdk = 24
targetSdk = 32
versionCode = 1
versionName = "1.0"
}
buildTypes {
getByName("release") {
isMinifyEnabled = false
}
}
}
application {
mainClass.set("from.wizard.application.ServerKt")
}
tasks.named<Copy>("jvmProcessResources") {
val jsBrowserDistribution = tasks.named("jsBrowserDistribution")
from(jsBrowserDistribution)
}
tasks.named<JavaExec>("run") {
dependsOn(tasks.named<Jar>("jvmJar"))
classpath(tasks.named<Jar>("jvmJar"))
}
czuckie
06/08/2023, 8:16 PMpluginManagement {
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
resolutionStrategy {
eachPlugin {
if (requested.id.namespace == "com.android") {
useModule("com.android.tools.build:gradle:7.3.1")
}
}
}
}
rootProject.name = "fromwizard"
CRamsan
06/08/2023, 8:16 PMapplication
, which is not compatible with the Android plugin. At least it was not compatible back when I tried this last, which was probably last year. Let me see if I can find the thread.czuckie
06/08/2023, 8:18 PMCRamsan
06/08/2023, 8:19 PMczuckie
06/08/2023, 8:19 PMczuckie
06/08/2023, 8:20 PMczuckie
06/08/2023, 8:22 PMCRamsan
06/08/2023, 8:25 PMczuckie
06/08/2023, 8:25 PM