skylot/jadx · error · JadxRuntimeException
Unsupported type for raw invoke-custom: {}
Error message
Unsupported type for raw invoke-custom: {} What it means
Thrown by EncodedValueUtils.convertToInsnArg when an invoke-custom bootstrap-method argument has an EncodedValue type not handled by the switch - i.e. something other than the primitives, STRING, TYPE, METHOD_TYPE, or METHOD_HANDLE (for example ENCODED_ARRAY, ENCODED_ANNOTATION, ENCODED_ENUM, ENCODED_FIELD, ENCODED_METHOD, or a new encoded type). invoke-custom args that are arrays/annotations/enum/field/method references are not yet converted to InsnArg form.
Source
Thrown at jadx-core/src/main/java/jadx/core/utils/EncodedValueUtils.java:101
case ENCODED_INT:
case ENCODED_LONG:
case ENCODED_FLOAT:
case ENCODED_DOUBLE:
return (InsnArg) convertToConstValue(value);
case ENCODED_BOOLEAN:
return InsnArg.lit(((Boolean) obj) ? 0 : 1, ArgType.BOOLEAN);
case ENCODED_STRING:
return InsnArg.wrapArg(new ConstStringNode((String) obj));
case ENCODED_TYPE:
return InsnArg.wrapArg(new ConstClassNode(ArgType.parse((String) obj)));
case ENCODED_METHOD_TYPE:
return InsnArg.wrapArg(buildMethodType(root, (IMethodProto) obj));
case ENCODED_METHOD_HANDLE:
return InsnArg.wrapArg(buildMethodHandle(root, (IMethodHandle) obj));
}
throw new JadxRuntimeException("Unsupported type for raw invoke-custom: " + value.getType());
}
private static InvokeNode buildMethodType(RootNode root, IMethodProto methodProto) {
ArgType retType = ArgType.parse(methodProto.getReturnType());
List<ArgType> argTypes = Utils.collectionMap(methodProto.getArgTypes(), ArgType::parse);
List<ArgType> callTypes = new ArrayList<>(1 + argTypes.size());
callTypes.add(retType);
callTypes.addAll(argTypes);
ArgType mthType = ArgType.object("java.lang.invoke.MethodType");
ClassInfo cls = ClassInfo.fromType(root, mthType);
MethodInfo mth = MethodInfo.fromDetails(root, cls, "methodType", callTypes, mthType);
InvokeNode invoke = new InvokeNode(mth, InvokeType.STATIC, callTypes.size());
for (ArgType type : callTypes) {
InsnNode argInsn;
if (type.isPrimitive()) {
argInsn = new IndexInsnNode(InsnType.SGET, getTypeField(root, type.getPrimitiveType()), 0);
} else {
argInsn = new ConstClassNode(type);View on GitHub (pinned to e738a26571)
Solutions
- Update jadx; encoded-value handling for invoke-custom is expanded over releases.
- Report the input and the encoded type from the message so the missing case can be added.
- Skip the affected class and continue the batch.
- Catch JadxRuntimeException around decompilation when using jadx as a library.
Defensive patterns
Strategy: try-catch
Try / catch
try {
InsnArg arg = EncodedValueUtils.convertToInsnArg(root, value);
} catch (JadxRuntimeException e) {
LOG.warn("unsupported invoke-custom encoded type {}", value.getType(), e);
} Prevention
- Update jadx for new encoded-value types.
- Catch around convertToInsnArg so one unsupported bootstrap arg degrades to a warn comment.
- Report the encoded type from the message so the missing case can be added.
When it happens
Trigger: Decompiling a class whose invoke-custom (LambdaMetafactory or custom bootstrap) declares a bootstrap argument that is an array, annotation, enum, field, or method encoded value. convertToInsnArg exhausts its switch cases and falls through to the throw.
Common situations: Apps that use non-LambdaMetafactory bootstraps with rich bootstrap arguments (e.g. string-dedup or constant-dynamic style), bytecode from newer DEX tooling, or hand-crafted invoke-custom instructions. Common bytecode (lambdas) only uses METHOD_TYPE/METHOD_HANDLE/TYPE/STRING and never hits this.
Related errors
- Can't build insn arg from encoded value: {}
- Failed to generate code for class: ${cls.getFullName()}
- Failed to process class: ${cls.getFullName()}
- Failed to process method to visitor:
- Failed to generate 'invoke-custom' instruction:
AI-assisted analysis of skylot/jadx@e738a26571 (2026-08-14).
Data as JSON: /api/errors/934a3e899baf8b4e.
Report an issue: GitHub.