{"record":{"id":"75bf150368b57743","repo":"alibaba/ARouter","slug":"arouter-register-logisticscenter-class-was-no","errorCode":null,"errorMessage":"ARouter::Register >>> LogisticsCenter.class was not found; automatic registration was not injected","messagePattern":"ARouter::Register >>> LogisticsCenter\\.class was not found; automatic registration was not injected","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"arouter-gradle-plugin/src/main/groovy/com/alibaba/android/arouter/register/core/ScopedRegisterTask.groovy","lineNumber":44,"sourceCode":"    @OutputFile\n    abstract RegularFileProperty getOutput()\n\n    @TaskAction\n    void registerRoutes() {\n        List<File> jars = allJars.get().collect { it.asFile }\n        List<File> directories = allDirectories.get().collect { it.asFile }\n\n        ScopedClassTransformer.Result result = ScopedClassTransformer.transform(\n                jars,\n                directories,\n                output.get().asFile\n        )\n\n        if (result.logisticsCenterFound) {\n            logger.info('ARouter::Register >>> Injected ' + result.registrationCount +\n                    ' route registration classes')\n        } else {\n            logger.warn('ARouter::Register >>> LogisticsCenter.class was not found; ' +\n                    'automatic registration was not injected')\n        }\n    }\n}\n","sourceCodeStart":26,"sourceCodeEnd":49,"githubUrl":"https://github.com/alibaba/ARouter/blob/84f451d244e3fb1d0e37801de1b9ee2af2f81d68/arouter-gradle-plugin/src/main/groovy/com/alibaba/android/arouter/register/core/ScopedRegisterTask.groovy#L26-L49","documentation":"Not an exception: ScopedRegisterTask logs this warning when, after scanning transformed classes, result.logisticsCenterFound is false — i.e. ARouter's LogisticsCenter.class was never seen, so automatic route registration could not be injected into it. The build succeeds but the generated routes will not be registered at runtime.","triggerScenarios":"The register task scans inputs that do not contain LogisticsCenter.class — e.g. the ARouter core dependency is missing from the variant, jar inputs are excluded, or the class lives in a jar not passed to the transformer/task.","commonSituations":"Forgetting the arouter-api dependency; shrinking/obfuscation config removing LogisticsCenter; registering only app module classes while LogisticsCenter resides in a library jar not included in the task inputs.","solutions":["Add the ARouter api dependency (`implementation 'com.alibaba:arouter-api:x.y.z'`) and ensure the compiler/gradle plugin versions match.","Check the task's input configuration includes the jar/dex containing LogisticsCenter.class.","Confirm R8/ProGuard keep rules for com.alibaba.android.arouter.launcher.LogisticsCenter so it survives shrinking."],"exampleFix":"// before (build.gradle)\ndependencies {\n    annotationProcessor 'com.alibaba:arouter-compiler:1.2.2'\n}\n\n// after\ndependencies {\n    implementation 'com.alibaba:arouter-api:1.5.2'\n    annotationProcessor 'com.alibaba:arouter-compiler:1.2.2'\n}","handlingStrategy":"validation","validationCode":"// verify in build.gradle before building\ndef hasApi = configurations.implementation.allDependencies.any {\n    it.group == 'com.alibaba' && it.name == 'arouter-api'\n}\nif (!hasApi) {\n    logger.warn('arouter-api missing: automatic route registration will be skipped')\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always include arouter-api when using the compiler plugin/register task.","Keep plugin and api versions aligned.","Add ProGuard keep rules for com.alibaba.android.arouter.launcher.**.","Check build logs for this warning in CI and fail the build when present."],"tags":["gradle-plugin","arouter","runtime-registration"],"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-14T00:17:10.932Z"}