{"record":{"id":"abc1e32b412841bb","repo":"bumptech/glide","slug":"failed-to-find-value-for-from-mirrors","errorCode":null,"errorMessage":"Failed to find value for: {} from mirrors: {}","messagePattern":"Failed to find value for: (.+?) from mirrors: (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"annotation/compiler/src/main/java/com/bumptech/glide/annotation/compiler/ProcessorUtil.java","lineNumber":557,"sourceCode":"\n  ImmutableSet<String> findClassValuesFromAnnotationOnClassAsNames(\n      Element clazz, Class<? extends Annotation> annotationClass) {\n    String annotationClassName = annotationClass.getName();\n    AnnotationValue excludedModuleAnnotationValue = null;\n    for (AnnotationMirror annotationMirror : clazz.getAnnotationMirrors()) {\n      // Two different AnnotationMirrors the same class might not be equal, so compare Strings\n      // instead. This check is necessary because a given class may have multiple Annotations.\n      if (!annotationClassName.equals(annotationMirror.getAnnotationType().toString())) {\n        continue;\n      }\n\n      var entries = annotationMirror.getElementValues().entrySet();\n      if (entries.size() != 1) {\n        throw new IllegalArgumentException(\"Expected single value, but found: \" + entries);\n      }\n      excludedModuleAnnotationValue = entries.iterator().next().getValue();\n      if (excludedModuleAnnotationValue == null) {\n        throw new IllegalArgumentException(\n            \"Failed to find value for: \"\n                + annotationClass\n                + \" from mirrors: \"\n                + clazz.getAnnotationMirrors());\n      }\n    }\n\n    if (excludedModuleAnnotationValue == null) {\n      return ImmutableSet.of();\n    }\n\n    Object value = excludedModuleAnnotationValue.getValue();\n    if (value instanceof List) {\n      LinkedHashSet<String> out = new LinkedHashSet<>();\n      for (Object o : (List<?>) value) {\n        AnnotationValue av = (AnnotationValue) o;\n        out.add(qualifiedNameFromTypeMirror((TypeMirror) av.getValue()));\n      }","sourceCodeStart":539,"sourceCodeEnd":575,"githubUrl":"https://github.com/bumptech/glide/blob/eb14a895d8f866e6a08c3e19d50ea3bd2c12c20a/annotation/compiler/src/main/java/com/bumptech/glide/annotation/compiler/ProcessorUtil.java#L539-L575","documentation":"Thrown by Glide's annotation processor in findClassValuesFromAnnotationOnClassAsNames() when an annotation (e.g. @Excludes) is matched by name on a class, has exactly one element-value entry, but entries.iterator().next().getValue() returns null. It means the processor located the right annotation mirror but could not extract a usable value from it.","triggerScenarios":"The annotation processor iterates clazz.getAnnotationMirrors(), matches one whose type name equals the target annotation class, confirms it has a single entry, then reads that entry's value. If the returned AnnotationValue is null (a state a conforming javac should not normally produce), the check at line 556 fires.","commonSituations":"An edge case in annotation processing: a malformed/source-only annotation, an Lombok or other non-standard processor rewriting annotations before Glide's runs, or an annotation written with an unusual default. Most often seen with IDE incremental compilation or a JDK/javac version that exposes annotation mirrors differently. Rare in practice.","solutions":["Run a clean build (./gradlew clean assemble or Build > Clean Project) to eliminate stale/incremental annotation state, then rebuild.","If using Lombok or another annotation rewriter, ensure it runs before Glide's processor in the kapt/ksp/processor ordering, or exclude the conflicting processor.","Inspect the full annotation mirrors dump in the error message to confirm the annotation is the one you expect and is not being rewritten.","If you maintain a custom @GlideModule, verify the annotation (e.g. @Excludes) is applied to resolvable classes and has the expected single value.","Update the JDK / Kotlin compiler plugin to a stable release to rule out a javac annotation-mirror bug."],"exampleFix":"// before\n@GlideModule\n@Excludes // <- missing value, or value rewriter nullified it\nclass MyModule : AppGlideModule()\n\n// after\n@GlideModule\n@Excludes(SomeOtherModule::class)\nclass MyModule : AppGlideModule()","handlingStrategy":"validation","validationCode":"// Before relying on an annotation value, confirm it resolves:\n// (compile-time check) ensure the annotation is present with a non-empty single value.\n@GlideModule\n@Excludes(ExcludedModule::class) // explicit, resolvable class literal\nclass MyModule : AppGlideModule()","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Apply Glide annotations with explicit, resolvable class-literal values.","Keep a single clean build pipeline; avoid mixing Lombok/non-standard rewriters with Glide's processor.","Clean the project after dependency changes to flush stale annotation state."],"tags":["annotation-processor","compile-time","glide-compiler","java"],"backgroundTag":null,"analyzedSha":"eb14a895d8f866e6a08c3e19d50ea3bd2c12c20a","analyzedAt":"2026-08-14T01:43:54.821Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}