{"record":{"id":"5ebce9d7b754324c","repo":"pxb1988/dex2jar","slug":"not-supported-yet-5ebce9","errorCode":null,"errorMessage":"Not supported yet.","messagePattern":"Not supported yet\\.","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"dex-translator/src/main/java/com/googlecode/d2j/dex/Asm2Dex.java","lineNumber":67,"sourceCode":"                return new MethodHandle(MethodHandle.INSTANCE_GET, toField(bsm.getOwner(), bsm.getName(), bsm.getDesc()));\n            case Opcodes.H_GETSTATIC:\n                return new MethodHandle(MethodHandle.STATIC_GET, toField(bsm.getOwner(), bsm.getName(), bsm.getDesc()));\n            case Opcodes.H_PUTFIELD:\n                return new MethodHandle(MethodHandle.INSTANCE_PUT, toField(bsm.getOwner(), bsm.getName(), bsm.getDesc()));\n            case Opcodes.H_PUTSTATIC:\n                return new MethodHandle(MethodHandle.STATIC_PUT, toField(bsm.getOwner(), bsm.getName(), bsm.getDesc()));\n            case Opcodes.H_INVOKEVIRTUAL:\n                return new MethodHandle(MethodHandle.INVOKE_INSTANCE, toMethod(bsm.getOwner(), bsm.getName(), bsm.getDesc()));\n            case Opcodes.H_INVOKESTATIC:\n                return new MethodHandle(MethodHandle.INVOKE_STATIC, toMethod(bsm.getOwner(), bsm.getName(), bsm.getDesc()));\n            case Opcodes.H_INVOKESPECIAL:\n                return new MethodHandle(MethodHandle.INVOKE_DIRECT, toMethod(bsm.getOwner(), bsm.getName(), bsm.getDesc()));\n            case Opcodes.H_NEWINVOKESPECIAL:\n                return new MethodHandle(MethodHandle.INVOKE_CONSTRUCTOR, toMethod(bsm.getOwner(), bsm.getName(), bsm.getDesc()));\n            case Opcodes.H_INVOKEINTERFACE:\n                return new MethodHandle(MethodHandle.INVOKE_INTERFACE, toMethod(bsm.getOwner(), bsm.getName(), bsm.getDesc()));\n            default:\n                throw new RuntimeException(\"Not supported yet.\");\n        }\n    }\n\n    static  private Method toMethod(String internalName, String name, String desc) {\n        return new Method(\"L\" + internalName + \";\", name, toMethodType(desc));\n    }\n\n    static private Field toField(String internalName, String name, String desc) {\n        return new Field(\"L\" + internalName + \";\", name, desc);\n    }\n\n    public static String[] toDescArray(Type[] ts) {\n        String[] ds = new String[ts.length];\n        for (int i = 0; i < ts.length; i++) {\n            ds[i] = ts[i].getDescriptor();\n        }\n        return ds;\n    }","sourceCodeStart":49,"sourceCodeEnd":85,"githubUrl":"https://github.com/pxb1988/dex2jar/blob/b5bda4fb4935ae8b3869b422454ae3b3896c7bc1/dex-translator/src/main/java/com/googlecode/d2j/dex/Asm2Dex.java#L49-L85","documentation":"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).","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"// before\njavac -source 8 -target 8 MyApp.java   // emits invokedynamic lambdas\n// after\njavac --release 7 MyApp.java  // or desugar first\njava -cp d8.jar com.android.tools.r8.D8 --min-api 19 --output out/ classes/","handlingStrategy":"try-catch","validationCode":"// Detect invokedynamic/method-handle constants in input classes\nClassReader cr = new ClassReader(bytes);\nboolean hasIndy = false;\ncr.accept(new ClassVisitor(Opcodes.ASM9) {\n    public FieldVisitor visitField(...) { return fv; }\n    public void visitEnd() {}\n}, 0);\n// or check class file major version >= 51 as a proxy for invokedynamic usage","typeGuard":"boolean usesInvokedynamic(ClassReader cr) {\n    return cr.readShort(6) >= Opcodes.V1_7; // major version offset in class header\n}","tryCatchPattern":"try {\n    asm2dex.convert(...);\n} catch (RuntimeException e) {\n    if (\"Not supported yet.\".equals(e.getMessage()) && isInMethodHandlePath(e)) {\n        artifact = desugarFirst(artifact); // D8/desugar_jdk_libs, then retry\n    } else throw e;\n}","preventionTips":["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"],"tags":["java","invokedynamic","method-handle","asm2dex"],"backgroundTag":"unsupported-enum-value","analyzedSha":"b5bda4fb4935ae8b3869b422454ae3b3896c7bc1","analyzedAt":"2026-09-08T00:44:01.258Z","contentChangedAt":"2026-09-08T00:44:01.258Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}