Search code examples
androidandroid-navigation

Build error: Cannot find symbol. Points to navigation actions


I keep getting an error that says that it cannot find the navigation actions. Here is the place that it gives me errors:

public void onItemClick(String item) {
        switch (card) {
            case ACCESSORIES:
                navController.navigate(TypeOfInfoFragmentDirections.actionTypeOfInfoToAccessories(item));
            case ARMOR_PIECES:
                navController.navigate(TypeOfInfoFragmentDirections.actionTypeOfInfoToArmorPieceType(item));
            case ARMOR_SETS:
                navController.navigate(TypeOfInfoFragmentDirections.actionTypeOfInfoToArmorSets(item));
            case DESTINIES:
                navController.navigate(TypeOfInfoFragmentDirections.actionTypeOfInfoToDestinyList(item));
            case ENEMIES:
                navController.navigate(TypeOfInfoFragmentDirections.actionTypeOfInfoToEnemyList(item));
            case GEMS:
                navController.navigate(TypeOfInfoFragmentDirections.actionTypeOfInfoToGemList(item));
            case LORESTONES:
                navController.navigate(TypeOfInfoFragmentDirections.actionTypeOfInfoToLoreSets(item));
            case POTIONS:
                navController.navigate(TypeOfInfoFragmentDirections.actionTypeOfInfoToPotionTypes(item));
            case QUESTS:
                navController.navigate(TypeOfInfoFragmentDirections.actionTypeOfInfoToQuestList(item));
            case SKILLBOOKS:
                navController.navigate(TypeOfInfoFragmentDirections.actionTypeOfInfoToSkillbook(item));
            case TRAINERS:
                navController.navigate(TypeOfInfoFragmentDirections.actionTypeOfInfoToTrainerList(item));
            case TWISTS:
                navController.navigate(TypeOfInfoFragmentDirections.actionTypeOfInfoToTwistList(item));
            case WEAPONS:
                navController.navigate(TypeOfInfoFragmentDirections.actionTypeOfInfoToWeaponList(item));

It gives me errors on all 13 navigation actions. Here is my gradle: https://pastebin.com/jaK6CK7z

And finally here is the navigation file: https://pastebin.com/8DyR7vpj As far as I can tell, I have all the elements needed. Any help is greatly appreciated.


Solution

  • I figured out the problem. I was trying to navigate to destinations that were in a nested NavGraph. I found that I did not need to have nested graphs, so taking out the graphs and leaving the fragments was all I needed to do.