Search code examples
androidandroid-jetpack-compose

None of the following functions can be called with the arguments supplied


I am trying to use this, but does not work. Not sure of why.

androidx.navigation.compose.NavHost(
        navHostController = navHostController,
        route = Graph.ROOT,
        startDestination = Graph.HOME
    ){

    }

I get the following error(s):

None of the following functions can be called with the arguments supplied.

  • NavHost(NavHostController, NavGraph, Modifier = ...) defined in androidx.navigation.compose
  • NavHost(NavHostController, String, Modifier = ..., String? = ..., NavGraphBuilder.() → Unit) defined in androidx.navigation.compose

Solution

  • There is a typo with navHostController. The parameter is navController

     androidx.navigation.compose.NavHost(
            navController = navHostController,
            //...
      )