{"record":{"id":"847d283f9aa98d9f","repo":"alibaba/ARouter","slug":"logisticscenterfatal-exception-when-loading-group","errorCode":null,"errorMessage":"LogisticsCenterFatal exception when loading group meta. [<failure>]","messagePattern":"LogisticsCenterFatal exception when loading group meta\\. \\[<failure>\\]","errorType":"exception","errorClass":"HandlerException","httpStatus":null,"severity":"error","filePath":"arouter-api/src/main/java/com/alibaba/android/arouter/core/LogisticsCenter.java","lineNumber":258,"sourceCode":"    public synchronized static boolean hasRoute(Postcard postcard) {\n        if (null == postcard\n                || TextUtils.isEmpty(postcard.getPath())\n                || TextUtils.isEmpty(postcard.getGroup())) {\n            return false;\n        }\n\n        if (Warehouse.routes.containsKey(postcard.getPath())) {\n            return true;\n        }\n\n        if (!Warehouse.groupsIndex.containsKey(postcard.getGroup())) {\n            return false;\n        }\n\n        try {\n            addRouteGroupDynamic(postcard.getGroup(), null);\n        } catch (Exception e) {\n            throw new HandlerException(\n                    TAG + \"Fatal exception when loading group meta. [\" + describeFailure(e) + \"]\",\n                    e\n            );\n        }\n\n        return Warehouse.routes.containsKey(postcard.getPath());\n    }\n\n    /**\n     * Completion the postcard by route metas\n     *\n     * @param postcard Incomplete postcard, should complete by this method.\n     */\n    public synchronized static void completion(Postcard postcard) {\n        if (null == postcard) {\n            throw new NoRouteFoundException(TAG + \"No postcard!\");\n        }\n","sourceCodeStart":240,"sourceCodeEnd":276,"githubUrl":"https://github.com/alibaba/ARouter/blob/84f451d244e3fb1d0e37801de1b9ee2af2f81d68/arouter-api/src/main/java/com/alibaba/android/arouter/core/LogisticsCenter.java#L240-L276","documentation":"hasRoute() checks whether a postcard's path can be resolved; if the route is not yet in Warehouse.routes it triggers addRouteGroupDynamic() to lazily load the group meta. Any exception from that lazy load is wrapped in a HandlerException tagged 'Fatal exception when loading group meta'.","triggerScenarios":"Calling ARouter's hasRoute/exist check for a path whose group class cannot be loaded — generated group class missing, ClassNotFoundException, or duplicate-key RuntimeException during dynamic group registration.","commonSituations":"Querying a route from a module whose generated ARouter$$Group class was stripped by R8; checking existence of a path registered by a module that was removed; stale build artifacts after renaming routes.","solutions":["Read the cause inside [<failure>] and fix the root exception (missing class, duplicate route, etc.)","Add keep rules for com.alibaba.android.arouter.routes.** in release builds","Run gradle clean and rebuild so generated group classes match current @Route declarations","Verify the module containing the route is an actual runtime dependency of the app"],"exampleFix":"// before\nboolean ok = ARouter.getInstance().hasRoute(path); // crashes on unloadable group\n// after\nboolean ok;\ntry {\n    ok = ARouter.getInstance().build(path).exist();\n} catch (HandlerException e) {\n    logger.warn(TAG, \"route check failed\", e);\n    ok = false;\n}","handlingStrategy":"try-catch","validationCode":"String group = path.split(\"/\")[1];\nif (!WarehouseGroupsKnown.contains(group) && !path.startsWith(\"/app/\")) {\n    Log.w(TAG, \"group \" + group + \" may not be registered\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    exists = postcard.exist();\n} catch (HandlerException e) {\n    Log.w(TAG, \"group meta load failed for path\", e);\n    exists = false; // treat as route-not-available\n}","preventionTips":["Keep com.alibaba.android.arouter.routes.** in release builds","Ensure the route's module is a runtime dependency","Clean build after route renames"],"tags":["arouter","route","lazy-loading","proguard"],"backgroundTag":"class-not-found","analyzedSha":"84f451d244e3fb1d0e37801de1b9ee2af2f81d68","analyzedAt":"2026-09-06T13:30:41.084Z","contentChangedAt":"2026-09-06T13:30:41.084Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}