alibaba/ARouter · warning
ARouter::Register >>> LogisticsCenter.class was not found…
Error message
ARouter::Register >>> LogisticsCenter.class was not found; automatic registration was not injected
What it means
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.
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.
Example fix
// before (build.gradle)
dependencies {
annotationProcessor 'com.alibaba:arouter-compiler:1.2.2'
}
// after
dependencies {
implementation 'com.alibaba:arouter-api:1.5.2'
annotationProcessor 'com.alibaba:arouter-compiler:1.2.2'
} Defensive patterns
Strategy: validation
Validate before calling
// verify in build.gradle before building
def hasApi = configurations.implementation.allDependencies.any {
it.group == 'com.alibaba' && it.name == 'arouter-api'
}
if (!hasApi) {
logger.warn('arouter-api missing: automatic route registration will be skipped')
} Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- ARouter::Init::Invoke init(context) first!
- ARouterCore::Init::Invoke init(context) first!
- Cannot create ARouter transform output directory
- Cannot replace temporary ARouter transform output
- Extract the default group failed, the path must be start…
AI-assisted analysis of alibaba/ARouter@84f451d244 (2026-09-06).
Data as JSON: /api/errors/75bf150368b57743.
Report an issue: GitHub.
Appendix: source
Thrown at arouter-gradle-plugin/src/main/groovy/com/alibaba/android/arouter/register/core/ScopedRegisterTask.groovy:44
@OutputFile
abstract RegularFileProperty getOutput()
@TaskAction
void registerRoutes() {
List<File> jars = allJars.get().collect { it.asFile }
List<File> directories = allDirectories.get().collect { it.asFile }
ScopedClassTransformer.Result result = ScopedClassTransformer.transform(
jars,
directories,
output.get().asFile
)
if (result.logisticsCenterFound) {
logger.info('ARouter::Register >>> Injected ' + result.registrationCount +
' route registration classes')
} else {
logger.warn('ARouter::Register >>> LogisticsCenter.class was not found; ' +
'automatic registration was not injected')
}
}
}
View on GitHub (pinned to 84f451d244)