I often get this error a lot in all my projects
Navigation action/destination com.speakerbooster.volumebass.equalizersound.amplifier:id/action_premiumFragment_to_dashboardFragment cannot be found from the current destination Destination(com.speakerbooster.volumebass.equalizersound.amplifier:id/autoCleanerFragment) label=fragment_auto_cleaner class=com.iobits.tech.volumebooster.presentation.fragments.AutoCleanerFragment
Thats how i using navigations to navigate
if (findNavController().currentDestination?.id == R.id.currentFragment) {
navigateTo(someactionId)
}
and here is the navigateTo() function
fun Fragment.navigateTo(actionId: Int, destinationName: Int) {
findNavController().navigate(
actionId,
null,
NavOptions.Builder().setPopUpTo(destinationName, true).build()
)
}