Unresolved reference: NavArgs after added some arguments to destination

In my case i typed the argument Name starting by a capital letter

        <argument
            android:name="MyArgument" // changed it to myArgument fix the problem
            app:argType="string"
            app:nullable="false" />

i had the same problem and i solved this by doing following steps

  1. Build -> Clean Project
  2. delete argument from nav_graph.xml file
  3. create new argument
  4. Build -> Rebuild Project
  5. set the argument
val action: NavDirections = AreThereAnyDecayedTeethInTheAreaOfPainFragmentDirections
                .actionAreThereAnyDecayedTeethInTheAreaOfPainFragmentToResultFragment(
                    finalresult = "somethings"
                )
  1. use this argument on FragmentDest
        arguments.let {
            binding.board.text = ResultFragmentArgs.fromBundle(it!!).finalresult
        }

As per the documentation on that very page:

When using the -ktx dependencies, Kotlin users can also use the by navArgs() property delegate to access arguments.

Make sure you are following the Adding Components documentation and using the navigation-fragment-ktx dependency:

implementation "android.arch.navigation:navigation-fragment-ktx:1.0.0-alpha11"