alibaba/ARouter · error · NoRouteFoundException

There is no route match the path [<path>], in group [<group>

Error message

There is no route match the path [<path>], in group [<group>]

What it means

completion() looks up the path in Warehouse.routes; if absent and the group has never been loaded (not in groupsIndex), it throws NoRouteFoundException listing the unmatched path and group. This is ARouter's 'route not registered' error — the target @Route annotation is missing, was stripped, or the path string differs.

Source

Thrown at arouter-api/src/main/java/com/alibaba/android/arouter/core/LogisticsCenter.java:281

        return Warehouse.routes.containsKey(postcard.getPath());
    }

    /**
     * Completion the postcard by route metas
     *
     * @param postcard Incomplete postcard, should complete by this method.
     */
    public synchronized static void completion(Postcard postcard) {
        if (null == postcard) {
            throw new NoRouteFoundException(TAG + "No postcard!");
        }

        RouteMeta routeMeta = Warehouse.routes.get(postcard.getPath());
        if (null == routeMeta) {
            // Maybe its does't exist, or didn't load.
            if (!Warehouse.groupsIndex.containsKey(postcard.getGroup())) {
                throw new NoRouteFoundException(TAG + "There is no route match the path [" + postcard.getPath() + "], in group [" + postcard.getGroup() + "]");
            } else {
                // Load route and cache it into memory, then delete from metas.
                try {
                    if (ARouter.debuggable()) {
                        logger.debug(TAG, String.format(Locale.getDefault(), "The group [%s] starts loading, trigger by [%s]", postcard.getGroup(), postcard.getPath()));
                    }

                    addRouteGroupDynamic(postcard.getGroup(), null);

                    if (ARouter.debuggable()) {
                        logger.debug(TAG, String.format(Locale.getDefault(), "The group [%s] has already been loaded, trigger by [%s]", postcard.getGroup(), postcard.getPath()));
                    }
                } catch (Exception e) {
                    throw new HandlerException(
                            TAG + "Fatal exception when loading group meta. [" + describeFailure(e) + "]",
                            e
                    );
                }

View on GitHub (pinned to 84f451d244)

Solutions

  1. Verify a @Route(path="...") exists with exactly the same path (and group prefix) as the one navigated to
  2. Add the module containing the route as a dependency of the app module and re-run ARouter.init()
  3. Check keep rules: -keep class com.alibaba.android.arouter.routes.** { *; } in release builds
  4. Log Warehouse.groupsIndex contents (debuggable mode) to confirm the group was registered

Example fix

// before
ARouter.getInstance().build("/user/detail").navigation(); // NoRouteFoundException
// after (target)
@Route(path = "/user/detail")
public class UserDetailActivity {...}
// and defensive nav
if (ARouter.getInstance().build("/user/detail").exist()) {
    ARouter.getInstance().build("/user/detail").navigation();
} else {
    // fallback to default activity
}
Defensive patterns

Strategy: try-catch

Validate before calling

boolean registered = ARouter.getInstance().build(path).exist();
if (!registered) {
    // fallback before navigating
}

Try / catch

try {
    ARouter.getInstance().build(path).navigation();
} catch (NoRouteFoundException e) {
    Log.e(TAG, "no route for " + path + ", using fallback", e);
    context.startActivity(new Intent(context, FallbackActivity.class));
}

Prevention

When it happens

Trigger: Navigating to a path with no matching @Route annotation; a typo'd path or mismatched group segment; the module containing the route is not a dependency; release build stripped generated route classes; navigation attempted before ARouter.init() loaded the group maps.

Common situations: Dynamic-feature modules whose routes load late; paths built at runtime via string concatenation that don't match the annotation; after renaming a route but not all navigation call sites.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


AI-assisted analysis of alibaba/ARouter@84f451d244 (2026-09-06). Data as JSON: /api/errors/e84be243a3b7f940. Report an issue: GitHub.