Paul Stern
09/18/2024, 4:00 PMMuaz KADAN
09/18/2024, 5:37 PMMuaz KADAN
09/18/2024, 5:37 PMMuaz KADAN
09/18/2024, 5:38 PMMuaz KADAN
09/18/2024, 5:38 PMPaul Stern
09/18/2024, 5:39 PMMuaz KADAN
09/18/2024, 5:40 PMMuaz KADAN
09/18/2024, 5:40 PMMuaz KADAN
09/18/2024, 5:40 PMPaul Stern
09/18/2024, 5:40 PMPaul Stern
09/19/2024, 5:29 AMPaul Stern
09/19/2024, 5:33 AMPaul Stern
09/19/2024, 5:34 AM[versions]
androidx-lifecycle = "2.8.0"
compose-plugin = "1.6.11"
junit = "4.13.2"
kotlin = "2.0.20"
kotlinx-coroutines = "1.8.1"
compose-navigation = "2.8.0-alpha10"
koin-bom = "4.0.0"
ktor = "3.0.0-rc-1"
[libraries]
kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin" }
kotlin-test-junit = { module = "org.jetbrains.kotlin:kotlin-test-junit", version.ref = "kotlin" }
junit = { group = "junit", name = "junit", version.ref = "junit" }
androidx-lifecycle-viewmodel = { group = "org.jetbrains.androidx.lifecycle", name = "lifecycle-viewmodel", version.ref = "androidx-lifecycle" }
androidx-lifecycle-runtime-compose = { group = "org.jetbrains.androidx.lifecycle", name = "lifecycle-runtime-compose", version.ref = "androidx-lifecycle" }
kotlinx-coroutines-swing = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-swing", version.ref = "kotlinx-coroutines" }
compose-navigation = { group = "org.jetbrains.androidx.navigation", name="navigation-compose", version.ref = "compose-navigation" }
[plugins]
jetbrainsCompose = { id = "org.jetbrains.compose", version.ref = "compose-plugin" }
compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
kotlinMultiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
Paul Stern
09/19/2024, 5:37 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.jetbrainsCompose)
alias(libs.plugins.compose.compiler)
}
kotlin {
@OptIn(ExperimentalWasmDsl::class)
wasmJs {
moduleName = "composeApp"
browser {
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(projectDirPath)
}
}
}
}
binaries.executable()
}
jvm("desktop")
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)
implementation(libs.compose.navigation)
}
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"
}
}
}
Paul Stern
09/19/2024, 5:43 AMPaul Stern
09/19/2024, 6:10 AMe: file:///home/paulstern/docs/dev/kmp-adreg/composeApp/src/commonMain/kotlin/org/example/project/App.kt:25:13 None of the following candidates is applicable:
fun NavHost(navController: NavHostController, graph: NavGraph, modifier: Modifier = ..., contentAlignment: Alignment = ..., enterTransition: AnimatedContentTransitionScope<NavBackStackEntry>.() -> EnterTransition = ..., exitTransition: AnimatedContentTransitionScope<NavBackStackEntry>.() -> ExitTransition = ..., popEnterTransition: AnimatedContentTransitionScope<NavBackStackEntry>.() -> EnterTransition = ..., popExitTransition: AnimatedContentTransitionScope<NavBackStackEntry>.() -> ExitTransition = ...): Unit
fun NavHost(navController: NavHostController, startDestination: String, modifier: Modifier = ..., contentAlignment: Alignment = ..., route: String? = ..., enterTransition: AnimatedContentTransitionScope<NavBackStackEntry>.() -> EnterTransition = ..., exitTransition: AnimatedContentTransitionScope<NavBackStackEntry>.() -> ExitTransition = ..., popEnterTransition: AnimatedContentTransitionScope<NavBackStackEntry>.() -> EnterTransition = ..., popExitTransition: AnimatedContentTransitionScope<NavBackStackEntry>.() -> ExitTransition = ..., builder: NavGraphBuilder.() -> Unit): Unit
Muaz KADAN
09/19/2024, 6:26 AMMuaz KADAN
09/19/2024, 6:26 AMPaul Stern
09/19/2024, 6:28 AMBox(modifier = Modifier.fillMaxSize()) {
NavHost(
navController = navigator,
startDestination = AppNavigation.Splash.route, // Fix: unknown parameter
modifier = Modifier.fillMaxSize()
) {}
}
and now I get no error in this place.
Sorry if it took too much of your attention)Muaz KADAN
09/19/2024, 6:29 AMMuaz KADAN
09/19/2024, 6:30 AMMuaz KADAN
09/19/2024, 6:32 AMBox(modifier = Modifier.fillMaxSize()) {
NavHost(
navController = navigator,
startDestination = AppNavigation.Splash.route, // Fix: unknown parameter
modifier = Modifier.fillMaxSize()
) {
composable(route = AppNavigation.Splash.route){
// content of splash screen
}
composable(route = AppNavigation.Login.route){
// content of login screen
}
}
}
Paul Stern
09/19/2024, 6:34 AM