# IllegalArgumentException: navigation destination com.example:id/destHome is not found in NavController

- **ID:** `android/navigation-destination-not-found`
- **Domain:** android
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 85%

## Root Cause

The navigation action references a destination ID that is not declared in the associated NavGraph, often due to a missing fragment or a typo in the navigation XML.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| AndroidX Navigation 2.5.3 | active | — | — |
| AndroidX Navigation 2.6.0 | active | — | — |

## Workarounds

1. **Ensure the destination ID is declared in the correct NavGraph file (e.g., nav_graph.xml) and that the action's destination attribute matches exactly. Example: <fragment android:id="@+id/destHome" android:name="com.example.HomeFragment" />** (85% success)
   ```
   Ensure the destination ID is declared in the correct NavGraph file (e.g., nav_graph.xml) and that the action's destination attribute matches exactly. Example: <fragment android:id="@+id/destHome" android:name="com.example.HomeFragment" />
   ```
2. **Use Safe Args to generate type-safe navigation actions. Add the Safe Args plugin to build.gradle and replace manual navigate calls with generated Directions classes.** (90% success)
   ```
   Use Safe Args to generate type-safe navigation actions. Add the Safe Args plugin to build.gradle and replace manual navigate calls with generated Directions classes.
   ```
3. **Verify that the NavController is initialized with the correct NavGraph by calling navController.setGraph(R.navigation.nav_graph) before navigating.** (80% success)
   ```
   Verify that the NavController is initialized with the correct NavGraph by calling navController.setGraph(R.navigation.nav_graph) before navigating.
   ```

## Dead Ends

- **** — The destination ID might be misspelled or not present in the current NavGraph, causing the same error. (75% fail)
- **** — Each NavController uses a specific NavGraph; adding to the wrong file doesn't resolve the reference. (80% fail)
- **** — The error is a code configuration issue, not a cached state issue. (90% fail)
