# java.lang.IllegalArgumentException：找不到深度链接的目标：https://example.com/path

- **ID:** `android/navigation-unknown-deeplink-host`
- **领域:** android
- **类别:** runtime_error
- **验证级别:** ai_generated
- **修复率:** 87%

## 根因

导航组件无法将深度链接 URI 匹配到 NavGraph 中任何已注册的目标，因为深度链接声明缺失或格式错误。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| Navigation 2.6.0 | active | — | — |
| Navigation 2.7.0 | active | — | — |
| Android 12 | active | — | — |
| Android 13 | active | — | — |

## 解决方案

1. ```
   Add a `<deepLink app:uri="https://example.com/path" />` element inside the corresponding `<fragment>` or `<activity>` in your nav_graph.xml file.
   ```
2. ```
   Verify the deep link URI pattern matches exactly, including path and query parameters. For dynamic paths, use placeholders like `{id}` in the URI.
   ```

## 无效尝试

- **** — Adding `<intent-filter>` in AndroidManifest.xml for the activity without corresponding <deepLink> in NavGraph causes mismatch. (80% 失败率)
- **** — Hardcoding the deep link URI in code without registering it in the NavGraph XML leads to the same error. (90% 失败率)
- **** — Using `app:uri` with incorrect scheme (e.g., 'http' instead of 'https') causes no match. (70% 失败率)
