bumptech/glide · error · IllegalArgumentException
Unrecognized static method name: {}
Error message
Unrecognized static method name: {} What it means
Thrown by getInstanceMethodNameFromStaticMethodName() when a static method in RequestOptions/GlideOptions that the generator must wrap has a name that matches none of the recognized patterns (bitmapTransform, decodeTypeOf, *Transform, *Of, noTransformation, noAnimation, option). The generator cannot derive the instance-method name to delegate to.
Source
Thrown at annotation/compiler/src/main/java/com/bumptech/glide/annotation/compiler/RequestOptionsGenerator.java:252
*/
private static String getInstanceMethodNameFromStaticMethodName(String staticMethodName) {
String equivalentInstanceMethodName;
if ("bitmapTransform".equals(staticMethodName)) {
equivalentInstanceMethodName = "transform";
} else if ("decodeTypeOf".equals(staticMethodName)) {
equivalentInstanceMethodName = "decode";
} else if (staticMethodName.endsWith("Transform")) {
equivalentInstanceMethodName = staticMethodName.substring(0, staticMethodName.length() - 9);
} else if (staticMethodName.endsWith("Of")) {
equivalentInstanceMethodName = staticMethodName.substring(0, staticMethodName.length() - 2);
} else if ("noTransformation".equals(staticMethodName)) {
equivalentInstanceMethodName = "dontTransform";
} else if ("noAnimation".equals(staticMethodName)) {
equivalentInstanceMethodName = "dontAnimate";
} else if (staticMethodName.equals("option")) {
equivalentInstanceMethodName = "set";
} else {
throw new IllegalArgumentException("Unrecognized static method name: " + staticMethodName);
}
return equivalentInstanceMethodName;
}
private MethodAndStaticVar generateStaticMethodEquivalentForRequestOptionsStaticMethod(
ExecutableElement staticMethod) {
boolean memoize = memoizeStaticMethodFromArguments(staticMethod);
String staticMethodName = staticMethod.getSimpleName().toString();
String equivalentInstanceMethodName =
getInstanceMethodNameFromStaticMethodName(staticMethodName);
MethodSpec.Builder methodSpecBuilder =
MethodSpec.methodBuilder(staticMethodName)
.addModifiers(Modifier.PUBLIC, Modifier.STATIC)
.addJavadoc(processorUtil.generateSeeMethodJavadoc(staticMethod))
.returns(glideOptionsName);
View on GitHub (pinned to eb14a895d8)
Solutions
- Align the versions of com.github.bumptech.glide:compiler and com.github.bumptech.glide:glide (and other Glide artifacts) to the same release.
- Run a clean build to discard stale generated sources after aligning versions.
- If you fork Glide, extend the name-mapping logic in RequestOptionsGenerator for any new static method names you introduce.
- Check for dependency shadowing/duplicates with ./gradlew dependencies and exclude conflicting Glide artifacts.
Example fix
// before (versions mismatched)
dependencies {
implementation 'com.github.bumptech.glide:glide:4.16.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'
}
// after (aligned)
dependencies {
implementation 'com.github.bumptech.glide:glide:4.16.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.16.0'
} Defensive patterns
Strategy: validation
Validate before calling
// Keep Glide artifacts version-aligned to avoid unrecognized static method names.
dependencies {
val glideVer = "4.16.0"
implementation("com.github.bumptech.glide:glide:$glideVer")
annotationProcessor("com.github.bumptech.glide:compiler:$glideVer")
} Prevention
- Pin all Glide artifacts (library + compiler) to one version.
- Run ./gradlew dependencies to detect duplicate/shadowed Glide artifacts.
- Clean the build after aligning versions.
When it happens
Trigger: During code generation the processor iterates the static methods of RequestOptions and maps each name to an instance method. If a static method name falls outside every known pattern, line 252 throws.
Common situations: A version mismatch between the glide:compiler (annotation processor) and glide:library artifacts, where the library added a new static method the older compiler does not recognize; using a fork of Glide that renamed/added static methods; processing the wrong RequestOptions class due to dependency shadowing.
Related errors
- Failed to find value for: {} from mirrors: {}
- Unresolved class type in annotation: {}
- The {} method annotated with @GlideOption in the {} @GlideEx
- Expected non-empty parameters for: {}
- GeneratedAppGlideModuleImpl is implemented incorrectly. If y
AI-assisted analysis of bumptech/glide@eb14a895d8 (2026-08-14).
Data as JSON: /api/errors/023dd62ccbf007eb.
Report an issue: GitHub.