bumptech/glide · error · IllegalArgumentException
Unrecognized annotation: {}
Error message
Unrecognized annotation: {} What it means
IndexerGenerator.getAnnotationValue maps an annotation class to its indexer key string ('modules' for GlideModule, 'extensions' for GlideExtension). Any other annotation class is unsupported and rejected defensively. This is a developer-only path inside the processor; users cannot trigger it through normal @GlideModule/@GlideExtension usage.
Source
Thrown at annotation/compiler/src/main/java/com/bumptech/glide/annotation/compiler/IndexerGenerator.java:128
if (indexerName.length() >= (MAXIMUM_FILE_NAME_LENGTH - INDEXER_NAME_PREFIX.length())) {
indexerName =
INDEXER_NAME_PREFIX
+ UUID.nameUUIDFromBytes(indexerName.getBytes()).toString().replace("-", "_");
}
return TypeSpec.classBuilder(indexerName)
.addAnnotation(annotationBuilder.build())
.addModifiers(Modifier.PUBLIC)
.build();
}
private static String getAnnotationValue(Class<? extends Annotation> annotation) {
if (annotation == GlideModule.class) {
return "modules";
} else if (annotation == GlideExtension.class) {
return "extensions";
} else {
throw new IllegalArgumentException("Unrecognized annotation: " + annotation);
}
}
}
View on GitHub (pinned to eb14a895d8)
Solutions
- If you forked Glide's compiler, extend getAnnotationValue to handle your new annotation class.
- Otherwise, report it as a Glide compiler bug with the full stack trace and Glide version.
Defensive patterns
Strategy: validation
Prevention
- This path is internal to Glide; if you hit it without forking the processor, report it upstream with the stack trace.
- Avoid running a forked glide:compiler alongside the official one.
When it happens
Trigger: IndexerGenerator.getAnnotationValue: `if (annotation == GlideModule.class) ... else if (annotation == GlideExtension.class) ... else throw`. Only reachable if internal Glide code calls getAnnotationValue with a different annotation type — i.e. an internal/programming error, not a user-annotation problem.
Common situations: Effectively unreachable for end users; would indicate a Glide compiler bug or a forked/modified processor that introduced a new indexer annotation without updating getAnnotationValue.
Related errors
- Unrecognized type: {}
- Given both modules and extensions, expected one or the other
- Cannot process annotations after writing AppGlideModule
- Expected single value, but found: {}
- Constructor for {} accepts too many parameters, it should ac
AI-assisted analysis of bumptech/glide@eb14a895d8 (2026-08-14).
Data as JSON: /api/errors/0f7a89d7f3e0fc17.
Report an issue: GitHub.