Open maxrave-dev opened 1 week ago
It works on a simple project with:
Compose Multiplatform version: 1.6.10
Navigation Multiplatform version: 2.7.0-alpha07
Kotlin version: 2.0.0
Code:
import androidx.compose.foundation.layout.Row
import androidx.compose.material3.Button
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Scaffold
import androidx.compose.runtime.Composable
import androidx.compose.runtime.DisposableEffect
import androidx.navigation.compose.NavHost
import androidx.navigation.compose.composable
import androidx.navigation.compose.rememberNavController
@Composable
fun App() {
MaterialTheme {
val navController = rememberNavController()
Scaffold(
bottomBar = {
Row {
Button({
navController.navigate("Home")
}) {}
Button({
navController.navigate("Settings")
}) {}
}
}
) {
NavHost(
navController = navController,
startDestination = BottomBarScreen.Home.route
) {
composable(route = BottomBarScreen.Home.route) {
DisposableEffect(Unit) {
println("Home")
onDispose { }
}
}
composable(route = BottomBarScreen.Settings.route) {
DisposableEffect(Unit) {
println("Settings")
onDispose { }
}
}
}
}
}
}
sealed class BottomBarScreen(
val route: String,
) {
object Home: BottomBarScreen(
route = "Home",
)
object Settings: BottomBarScreen(
route = "Settings",
)
}
NoSuchMethodError
usually indicates there is a binary incompatibility, could you provide your project or just build.gradle
with the dependencies and gradle/lib.versions.toml
?
Describe the bug When I try to build and run Compose Desktop App in my Ubuntu 23.10, I have an error
But when I run in Android Target, it runs normally.
Affected platforms
Versions
To Reproduce Steps to reproduce the behavior:
Expected behavior Should not crash and show navigation bar like Android Target
Screenshots
Additional context Crash log: