pxb1988/dex2jar · error · RuntimeException
Not supported yet.
Error message
Not supported yet.
What it means
Thrown by Asm2Dex.toMethodHandle() when it encounters a MethodHandle kind it cannot map from ASM/Java bytecode handle tags to the dex MethodHandle constants. The default case covers handle kinds with no equivalent in the implemented mapping (e.g. H_INVOKESTATIC without a matching case in this build, or unexpected new handle kinds from newer class files).
Solutions
- Upgrade dex-translator / ASM to a version that maps all method-handle tags (including H_INVOKESTATIC)
- Compile the input with a dex-compatible target (e.g. javac --release 7/8 with -XDstringConcat=inline and desugaring enabled, or use D8/R8 desugaring) to remove invokedynamic
- Pre-desugar the jar with a tool like the D8 desugar step before running this converter
Example fix
// before javac -source 8 -target 8 MyApp.java // emits invokedynamic lambdas // after javac --release 7 MyApp.java // or desugar first java -cp d8.jar com.android.tools.r8.D8 --min-api 19 --output out/ classes/
Defensive patterns
Strategy: try-catch
Validate before calling
// Detect invokedynamic/method-handle constants in input classes
ClassReader cr = new ClassReader(bytes);
boolean hasIndy = false;
cr.accept(new ClassVisitor(Opcodes.ASM9) {
public FieldVisitor visitField(...) { return fv; }
public void visitEnd() {}
}, 0);
// or check class file major version >= 51 as a proxy for invokedynamic usage Type guard
boolean usesInvokedynamic(ClassReader cr) {
return cr.readShort(6) >= Opcodes.V1_7; // major version offset in class header
} Try / catch
try {
asm2dex.convert(...);
} catch (RuntimeException e) {
if ("Not supported yet.".equals(e.getMessage()) && isInMethodHandlePath(e)) {
artifact = desugarFirst(artifact); // D8/desugar_jdk_libs, then retry
} else throw e;
} Prevention
- Compile with --release 7 or lower, or enable desugaring, to avoid invokedynamic
- Keep ASM and dex-translator updated so all handle tags are mapped
- Scan input jars for class version >= 51 before conversion
- Prefer D8/R8 desugared artifacts as converter input
When it happens
Trigger: Converting Java 7+ bytecode that uses invokedynamic / MethodHandle constant pool entries (lambda metafactory, string concat) where the handle's getTag() falls into an unmapped case during constant conversion via convertConstantValue.
Common situations: Jar-to-dex conversion of code compiled for Java 8+ that relies on invokedynamic (lambdas, method references, string concat) while the translator's ASM version or handle mapping is incomplete/outdated.
Related errors
AI-assisted analysis of pxb1988/dex2jar@b5bda4fb49 (2026-09-08).
Data as JSON: /api/errors/5ebce9d7b754324c.
Report an issue: GitHub.
Appendix: source
Thrown at dex-translator/src/main/java/com/googlecode/d2j/dex/Asm2Dex.java:67
return new MethodHandle(MethodHandle.INSTANCE_GET, toField(bsm.getOwner(), bsm.getName(), bsm.getDesc()));
case Opcodes.H_GETSTATIC:
return new MethodHandle(MethodHandle.STATIC_GET, toField(bsm.getOwner(), bsm.getName(), bsm.getDesc()));
case Opcodes.H_PUTFIELD:
return new MethodHandle(MethodHandle.INSTANCE_PUT, toField(bsm.getOwner(), bsm.getName(), bsm.getDesc()));
case Opcodes.H_PUTSTATIC:
return new MethodHandle(MethodHandle.STATIC_PUT, toField(bsm.getOwner(), bsm.getName(), bsm.getDesc()));
case Opcodes.H_INVOKEVIRTUAL:
return new MethodHandle(MethodHandle.INVOKE_INSTANCE, toMethod(bsm.getOwner(), bsm.getName(), bsm.getDesc()));
case Opcodes.H_INVOKESTATIC:
return new MethodHandle(MethodHandle.INVOKE_STATIC, toMethod(bsm.getOwner(), bsm.getName(), bsm.getDesc()));
case Opcodes.H_INVOKESPECIAL:
return new MethodHandle(MethodHandle.INVOKE_DIRECT, toMethod(bsm.getOwner(), bsm.getName(), bsm.getDesc()));
case Opcodes.H_NEWINVOKESPECIAL:
return new MethodHandle(MethodHandle.INVOKE_CONSTRUCTOR, toMethod(bsm.getOwner(), bsm.getName(), bsm.getDesc()));
case Opcodes.H_INVOKEINTERFACE:
return new MethodHandle(MethodHandle.INVOKE_INTERFACE, toMethod(bsm.getOwner(), bsm.getName(), bsm.getDesc()));
default:
throw new RuntimeException("Not supported yet.");
}
}
static private Method toMethod(String internalName, String name, String desc) {
return new Method("L" + internalName + ";", name, toMethodType(desc));
}
static private Field toField(String internalName, String name, String desc) {
return new Field("L" + internalName + ";", name, desc);
}
public static String[] toDescArray(Type[] ts) {
String[] ds = new String[ts.length];
for (int i = 0; i < ts.length; i++) {
ds[i] = ts[i].getDescriptor();
}
return ds;
}View on GitHub (pinned to b5bda4fb49)