{"record":{"id":"f0ba5756b2b6a0b3","repo":"alibaba/ARouter","slug":"arouter-compiler-no-module-name-for-more-inf","errorCode":null,"errorMessage":"ARouter::Compiler >>> No module name, for more information, look at gradle log.","messagePattern":"ARouter::Compiler >>> No module name, for more information, look at gradle log\\.","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"arouter-compiler/src/main/java/com/alibaba/android/arouter/compiler/processor/BaseProcessor.java","lineNumber":64,"sourceCode":"        types = processingEnv.getTypeUtils();\n        elementUtils = processingEnv.getElementUtils();\n        typeUtils = new TypeUtils(types, elementUtils);\n        logger = new Logger(processingEnv.getMessager());\n\n        // Attempt to get user configuration [moduleName]\n        Map<String, String> options = processingEnv.getOptions();\n        if (MapUtils.isNotEmpty(options)) {\n            moduleName = options.get(KEY_MODULE_NAME);\n            generateDoc = VALUE_ENABLE.equals(options.get(KEY_GENERATE_DOC_NAME));\n        }\n\n        if (StringUtils.isNotEmpty(moduleName)) {\n            moduleName = moduleName.replaceAll(\"[^0-9a-zA-Z_]+\", \"\");\n\n            logger.info(\"The user has configuration the module name, it was [\" + moduleName + \"]\");\n        } else {\n            logger.error(NO_MODULE_NAME_TIPS);\n            throw new RuntimeException(\"ARouter::Compiler >>> No module name, for more information, look at gradle log.\");\n        }\n    }\n\n    @Override\n    public SourceVersion getSupportedSourceVersion() {\n        return SourceVersion.latestSupported();\n    }\n\n    @Override\n    public Set<String> getSupportedOptions() {\n        return new HashSet<String>() {{\n            this.add(KEY_MODULE_NAME);\n            this.add(KEY_GENERATE_DOC_NAME);\n        }};\n    }\n\n    /**\n     * Resolve a type that may not be present on the consuming module's classpath.","sourceCodeStart":46,"sourceCodeEnd":82,"githubUrl":"https://github.com/alibaba/ARouter/blob/84f451d244e3fb1d0e37801de1b9ee2af2f81d68/arouter-compiler/src/main/java/com/alibaba/android/arouter/compiler/processor/BaseProcessor.java#L46-L82","documentation":"Thrown in BaseProcessor.init when the APT option AROUTER_MODULE_NAME (or fallback AROUTER_GENERATE_DOC_NAME-style option) is empty. ARouter's compiler needs a per-module name to namespace generated group/index classes; without it compilation fails with this RuntimeException. The gradle plugin normally injects this option automatically.","triggerScenarios":"Running annotation processing (javac/kapt) on a module without the AROUTER_MODULE_NAME apt option set; applying ARouter without the `apply plugin: 'com.alibaba.arouter'` gradle plugin; processing triggered from an IDE build that skips the plugin's configuration step.","commonSituations":"Adding arouter-compiler to kapt without the ARouter gradle plugin; building a new module; running annotation processing in a non-Gradle build (Bazel, plain javac) where the option was never passed.","solutions":["Apply `apply plugin: 'com.alibaba.arouter'` in the module's build.gradle so the plugin supplies AROUTER_MODULE_NAME.","Or set it manually: kapt { arguments { arg(\"AROUTER_MODULE_NAME\", project.getName()) } } (or javaCompileOptions.annotationProcessorOptions.arguments for non-kapt).","Check `gradle log`/stack trace as the message suggests to confirm which processor invocation lacked the option."],"exampleFix":"// before (build.gradle)\napply plugin: 'com.android.application'\n\n// after\napply plugin: 'com.android.application'\napply plugin: 'com.alibaba.arouter'\n\nkapt {\n    arguments { arg(\"AROUTER_MODULE_NAME\", project.getName()) }\n}","handlingStrategy":"validation","validationCode":"// in build.gradle, verify before compilation\ndef hasArouterPlugin = plugins.hasPlugin('com.alibaba.arouter')\ndef moduleName = hasArouterPlugin ? project.getName() : null\nif (moduleName == null) {\n    throw new GradleException(\"Set AROUTER_MODULE_NAME: apply plugin 'com.alibaba.arouter' or pass kapt arg\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always apply the com.alibaba.arouter gradle plugin in modules using ARouter.","Explicitly set kapt arg AROUTER_MODULE_NAME in each module's build.gradle.","Check that IDE/CI builds run the same Gradle configuration as the command line."],"tags":["gradle","annotation-processor","configuration"],"backgroundTag":"missing-required-config","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"}