Giorgi
12/03/2024, 10:27 AMe: Kotlin Target 'jvm()' is already declared.
error. Any ideas how to fix?Giorgi
12/03/2024, 10:27 AMe: Kotlin Target 'jvm()' is already declared.
<====---------> 33% CONFIGURING [4
Declaring multiple Kotlin Targets of the same type is not supported.
Read <https://kotl.in/declaring-multiple-targets> for details.
e: Kotlin Target 'jvm()' is already declared.
> :multiplatform-ui:generateA
Declaring multiple Kotlin Targets of the same type is not supported.
Read <https://kotl.in/declaring-multiple-targets> for details.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':parser:checkKotlinGradlePluginConfigurationErrors'.
> Kotlin Gradle Plugin reported errors. Check the log for details
* Try:
> 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>.
BUILD FAILED in 2s
Closed process
Wout Werkman
12/03/2024, 10:44 AMGiorgi
12/03/2024, 10:54 AMimport org.jetbrains.compose.desktop.application.dsl.TargetFormat
import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl
import org.jetbrains.kotlin.gradle.targets.js.webpack.KotlinWebpackConfig
plugins {
alias(libs.plugins.kotlinMultiplatform)
alias(libs.plugins.composeMultiplatform)
alias(libs.plugins.composeCompiler)
}
kotlin {
jvm("desktop")
@OptIn(ExperimentalWasmDsl::class)
wasmJs {
moduleName = "composeApp"
browser {
val rootDirPath = project.rootDir.path
val projectDirPath = project.projectDir.path
commonWebpackConfig {
outputFileName = "composeApp.js"
devServer = (devServer ?: KotlinWebpackConfig.DevServer()).apply {
static = (static ?: mutableListOf()).apply {
// Serve sources to debug inside browser
add(rootDirPath)
add(projectDirPath)
}
}
}
}
binaries.executable()
}
sourceSets {
val desktopMain by getting
commonMain.dependencies {
implementation(compose.runtime)
implementation(compose.foundation)
implementation(compose.material)
implementation(compose.ui)
implementation(compose.components.resources)
implementation(compose.components.uiToolingPreview)
implementation(libs.androidx.lifecycle.viewmodel)
implementation(libs.androidx.lifecycle.runtime.compose)
}
desktopMain.dependencies {
implementation(compose.desktop.currentOs)
implementation(libs.kotlinx.coroutines.swing)
}
}
}
compose.desktop {
application {
mainClass = "org.example.project.MainKt"
nativeDistributions {
targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb)
packageName = "org.example.project"
packageVersion = "1.0.0"
}
}
}
Giorgi
12/03/2024, 10:54 AMjvm("desktop")
Wout Werkman
12/03/2024, 11:22 AMApp
function in commonMain
.
Which version of Fleet are you using?Giorgi
12/03/2024, 1:43 PMGiorgi
12/03/2024, 1:44 PMGiorgi
12/03/2024, 1:50 PMGiorgi
12/03/2024, 1:53 PMWout Werkman
12/03/2024, 10:51 PMGiorgi
12/05/2024, 11:28 AMWout Werkman
12/05/2024, 11:33 AMGiorgi
12/05/2024, 11:42 AMGiorgi
12/05/2024, 11:42 AMGiorgi
12/05/2024, 11:43 AMWout Werkman
12/05/2024, 12:24 PMGiorgi
12/05/2024, 1:21 PM