alibaba/ARouter · critical · HandlerException

LogisticsCenterARouter init logistics center exception! [<fa

Error message

LogisticsCenterARouter init logistics center exception! [<failure>]

What it means

LogisticsCenter.init() loads ARouter's route/interceptor/provider indexes into Warehouse and wraps any unexpected exception in a HandlerException prefixed with the LogisticsCenter tag. The [<failure>] part (describeFailure(e)) carries the underlying cause description so you know which generated class or scan step failed.

Source

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

                        ((IInterceptorGroup) (Class.forName(className).getConstructor().newInstance())).loadInto(Warehouse.interceptorsIndex);
                    } else if (className.startsWith(ROUTE_ROOT_PAKCAGE + DOT + SDK_NAME + SEPARATOR + SUFFIX_PROVIDERS)) {
                        // Load providerIndex
                        ((IProviderGroup) (Class.forName(className).getConstructor().newInstance())).loadInto(Warehouse.providersIndex);
                    }
                }
            }

            logger.info(TAG, "Load root element finished, cost " + (System.currentTimeMillis() - startInit) + " ms.");

            if (Warehouse.groupsIndex.size() == 0) {
                logger.error(TAG, "No mapping files were found, check your configuration please!");
            }

            if (ARouter.debuggable()) {
                logger.debug(TAG, String.format(Locale.getDefault(), "LogisticsCenter has already been loaded, GroupIndex[%d], InterceptorIndex[%d], ProviderIndex[%d]", Warehouse.groupsIndex.size(), Warehouse.interceptorsIndex.size(), Warehouse.providersIndex.size()));
            }
        } catch (Exception e) {
            throw new HandlerException(
                    TAG + "ARouter init logistics center exception! [" + describeFailure(e) + "]",
                    e
            );
        }
    }

    /**
     * Build postcard by serviceName
     *
     * @param serviceName interfaceName
     * @return postcard
     */
    public static Postcard buildProvider(String serviceName) {
        RouteMeta meta = Warehouse.providersIndex.get(serviceName);

        if (null == meta) {
            return null;
        } else {

View on GitHub (pinned to 84f451d244)

Solutions

  1. Read the nested failure in [<failure>]/cause and fix the specific root cause (duplicate path, missing class, etc.)
  2. Add ARouter-generated classes to ProGuard keep rules: -keep class * extends com.alibaba.android.arouter.facade.* and keep @Route/@Autowired annotated classes
  3. Align arouter-api, arouter-compiler and arouter-annotation versions across all modules; run gradle clean
  4. Ensure provider classes declared in @Route have a public default constructor

Example fix

// before (proguard-rules.pro)
# (no ARouter rules)
// after
-keep class com.alibaba.android.arouter.routes.** { *; }
-keep @com.alibaba.android.arouter.facade.annotation.Route class * { *; }
-keep class * implements com.alibaba.android.arouter.facade.template.IProvider { *; }
Defensive patterns

Strategy: try-catch

Validate before calling

// preflight: ensure ARouter deps and generated classes exist
if (!checkClassPresent("com.alibaba.android.arouter.routes.ARouter$$Group$$app")) {
    Log.e(TAG, "ARouter generated classes missing; check compiler plugin + proguard");
}

Try / catch

try {
    ARouter.init(application);
} catch (HandlerException e) {
    Log.e(TAG, "ARouter init failed: " + e.getMessage(), e.getCause());
    // degrade: fall back to explicit Intent navigation
}

Prevention

When it happens

Trigger: Any Exception during init: a UniqueKeyTreeMap duplicate-route throw, ClassNotFoundException for a listed route/interceptor/provider class, InstantiationException/IllegalAccessException when instantiating providers, or IO errors reading generated group files.

Common situations: ProGuard/R8 stripping or renaming generated route classes; mixed ARouter compiler versions producing incompatible metadata; a provider class without a public no-arg constructor; duplicate route paths across modules.

Related errors


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