skylot/jadx · warning · JadxRuntimeException
Can't decode value:
Error message
Can't decode value:
What it means
Thrown by AnnotationGen.encodeValue() as the default branch of the switch on encodedValue.getType(). All known EncodedValueType values (ENCODED_NULL through ENCODED_ANNOTATION) are handled; reaching the default means an unrecognized encoded value type was encountered. This indicates either a corrupted DEX annotation or a future DEX format extension.
Source
Thrown at jadx-core/src/main/java/jadx/core/codegen/AnnotationGen.java:219
break;
case ENCODED_ARRAY:
code.add('{');
Iterator<?> it = ((Iterable<?>) value).iterator();
while (it.hasNext()) {
EncodedValue v = (EncodedValue) it.next();
encodeValue(cls.root(), code, v);
if (it.hasNext()) {
code.add(", ");
}
}
code.add('}');
break;
case ENCODED_ANNOTATION:
formatAnnotation(code, (IAnnotation) value);
break;
default:
throw new JadxRuntimeException("Can't decode value: " + encodedValue.getType() + " (" + encodedValue + ')');
}
}
private StringUtils getStringUtils() {
return cls.root().getStringUtils();
}
}
View on GitHub (pinned to e738a26571)
Solutions
- Update jadx to the latest version — newer releases may handle additional encoded value types.
- Report the offending DEX file as a test case to the jadx issue tracker.
- Exclude the affected class or use fallback decompilation mode to skip annotation generation.
Defensive patterns
Strategy: try-catch
Try / catch
try {
annotationGen.encodeValue(root, code, encodedValue);
} catch (JadxRuntimeException e) {
if (e.getMessage().startsWith("Can't decode value")) {
// Fallback: emit the raw encoded value as a comment
code.add("/* unsupported annotation value type: " + encodedValue.getType() + " */");
logger.warn("Unsupported annotation encoded value type", e);
} else {
throw e;
}
} Prevention
- Update jadx to handle newer DEX annotation value types.
- Use fallback mode for obfuscated or non-standard DEX files.
- Report the DEX file as a test case to the jadx project.
When it happens
Trigger: Processing a DEX file whose annotation contains an encoded value type constant not in the known set. Corrupted annotation data or a novel obfuscation technique that produces non-standard encoded value tags.
Common situations: Heavily obfuscated APKs with modified DEX structures. DEX files produced by non-standard compilers or post-processing tools.
Related errors
- Unexpected field type class:
- Failed to generate 'invoke-custom' instruction:
- Input class not found: {}
- Failed to generate code for class: ${cls.getFullName()}
- Method generation error
AI-assisted analysis of skylot/jadx@e738a26571 (2026-08-14).
Data as JSON: /api/errors/13fa44acde79519b.
Report an issue: GitHub.