bumptech/glide · error · IllegalArgumentException

Unresolved class type in annotation: {}

Error message

Unresolved class type in annotation: {}

What it means

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.

Source

Thrown at annotation/compiler/src/main/java/com/bumptech/glide/annotation/compiler/ProcessorUtil.java:584

      return ImmutableSet.of();
    }

    Object value = excludedModuleAnnotationValue.getValue();
    if (value instanceof List) {
      LinkedHashSet<String> out = new LinkedHashSet<>();
      for (Object o : (List<?>) value) {
        AnnotationValue av = (AnnotationValue) o;
        out.add(qualifiedNameFromTypeMirror((TypeMirror) av.getValue()));
      }
      return ImmutableSet.copyOf(out);
    } else {
      return ImmutableSet.of(qualifiedNameFromTypeMirror((TypeMirror) value));
    }
  }

  static String qualifiedNameFromTypeMirror(TypeMirror type) {
    if (type.getKind() == TypeKind.ERROR) {
      throw new IllegalArgumentException("Unresolved class type in annotation: " + type);
    }
    if (type.getKind() == TypeKind.DECLARED) {
      DeclaredType dt = (DeclaredType) type;
      TypeElement te = (TypeElement) dt.asElement();
      return te.getQualifiedName().toString();
    }
    return type.toString();
  }

  private enum MethodType {
    STATIC,
    INSTANCE
  }

  private final class FilterPublicMethods implements Predicate<Element> {
    @Nullable private final TypeMirror returnType;
    private final MethodType methodType;

View on GitHub (pinned to eb14a895d8)

Solutions

  1. Read the offending type name from the error message and confirm the class exists and is spelled correctly.
  2. Add the module/dependency that contains the referenced class to the annotation-processor (kapt/ksp/annotationProcessor) configuration, not just the runtime classpath.
  3. If the class was removed or renamed, update the annotation to reference the correct type.
  4. Run a clean build to discard stale symbol caches after fixing the reference.

Example fix

// before
@GlideModule
@Excludes(OldRemovedModule::class) // OldRemovedModule no longer exists
class MyModule : AppGlideModule()

// after
@GlideModule
@Excludes(CurrentModule::class)
class MyModule : AppGlideModule()
Defensive patterns

Strategy: validation

Validate before calling

// Ensure every class referenced in a Glide annotation is on the compile classpath.
@Excludes(ExcludedModule::class) // ExcludedModule must be a compile dependency, not runtime-only

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of bumptech/glide@eb14a895d8 (2026-08-14). Data as JSON: /api/errors/4c1bdf34e0f77522. Report an issue: GitHub.