{"record":{"id":"4c1bdf34e0f77522","repo":"bumptech/glide","slug":"unresolved-class-type-in-annotation","errorCode":null,"errorMessage":"Unresolved class type in annotation: {}","messagePattern":"Unresolved class type in annotation: (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"annotation/compiler/src/main/java/com/bumptech/glide/annotation/compiler/ProcessorUtil.java","lineNumber":584,"sourceCode":"      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      }\n      return ImmutableSet.copyOf(out);\n    } else {\n      return ImmutableSet.of(qualifiedNameFromTypeMirror((TypeMirror) value));\n    }\n  }\n\n  static String qualifiedNameFromTypeMirror(TypeMirror type) {\n    if (type.getKind() == TypeKind.ERROR) {\n      throw new IllegalArgumentException(\"Unresolved class type in annotation: \" + type);\n    }\n    if (type.getKind() == TypeKind.DECLARED) {\n      DeclaredType dt = (DeclaredType) type;\n      TypeElement te = (TypeElement) dt.asElement();\n      return te.getQualifiedName().toString();\n    }\n    return type.toString();\n  }\n\n  private enum MethodType {\n    STATIC,\n    INSTANCE\n  }\n\n  private final class FilterPublicMethods implements Predicate<Element> {\n    @Nullable private final TypeMirror returnType;\n    private final MethodType methodType;\n","sourceCodeStart":566,"sourceCodeEnd":602,"githubUrl":"https://github.com/bumptech/glide/blob/eb14a895d8f866e6a08c3e19d50ea3bd2c12c20a/annotation/compiler/src/main/java/com/bumptech/glide/annotation/compiler/ProcessorUtil.java#L566-L602","documentation":"Thrown by qualifiedNameFromTypeMirror() when a TypeMirror referenced inside a Glide annotation has kind TypeKind.ERROR, meaning the class could not be resolved on the annotation-processing classpath. The processor cannot turn an unresolved type into a fully qualified name, so it aborts.","triggerScenarios":"A class literal used inside a Glide annotation (such as a class listed in @Excludes, or a type value read by findClassValuesFromAnnotationOnClassAsNames) resolves to TypeKind.ERROR during processing because that class is absent from the compile classpath.","commonSituations":"Referencing a class in @Excludes that lives in a module not on the annotation-processor classpath; a typo in a class name; a removed/renamed class after a refactor or dependency upgrade; split modules where the referenced class is only a runtime dependency.","solutions":["Read the offending type name from the error message and confirm the class exists and is spelled correctly.","Add the module/dependency that contains the referenced class to the annotation-processor (kapt/ksp/annotationProcessor) configuration, not just the runtime classpath.","If the class was removed or renamed, update the annotation to reference the correct type.","Run a clean build to discard stale symbol caches after fixing the reference."],"exampleFix":"// before\n@GlideModule\n@Excludes(OldRemovedModule::class) // OldRemovedModule no longer exists\nclass MyModule : AppGlideModule()\n\n// after\n@GlideModule\n@Excludes(CurrentModule::class)\nclass MyModule : AppGlideModule()","handlingStrategy":"validation","validationCode":"// Ensure every class referenced in a Glide annotation is on the compile classpath.\n@Excludes(ExcludedModule::class) // ExcludedModule must be a compile dependency, not runtime-only","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Put referenced classes on the annotationProcessor/kapt/ksp classpath, not just runtime.","Run a clean build after refactors that rename or move referenced classes.","Treat any TypeKind.ERROR in annotation values as a missing-class signal and fix the reference."],"tags":["annotation-processor","compile-time","classpath","type-resolution","java"],"backgroundTag":null,"analyzedSha":"eb14a895d8f866e6a08c3e19d50ea3bd2c12c20a","analyzedAt":"2026-08-14T01:43:54.821Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}