{"record":{"id":"a2b80ecc5f55ccb8","repo":"Tencent/tinker","slug":"instruction-format-s-not-supported","errorCode":null,"errorMessage":"Instruction format %s not supported","messagePattern":"Instruction format (.+?) not supported","errorType":"exception","errorClass":"ExceptionWithContext","httpStatus":null,"severity":"critical","filePath":"tinker-build/tinker-patch-lib/src/main/java/org/jf/dexlib2/builder/BuilderMutableMethodImplementation.java","lineNumber":768,"sourceCode":"            case Format3rc:\n                setInstruction(location, newBuilderInstruction3rc((Instruction3rc) instruction));\n                return;\n            case Format51l:\n                setInstruction(location, newBuilderInstruction51l((Instruction51l) instruction));\n                return;\n            case PackedSwitchPayload:\n                setInstruction(location,\n                        newBuilderPackedSwitchPayload(location, codeAddressToIndex, (PackedSwitchPayload) instruction));\n                return;\n            case SparseSwitchPayload:\n                setInstruction(location,\n                        newBuilderSparseSwitchPayload(location, codeAddressToIndex, (SparseSwitchPayload) instruction));\n                return;\n            case ArrayPayload:\n                setInstruction(location, newBuilderArrayPayload((ArrayPayload) instruction));\n                return;\n            default:\n                throw new ExceptionWithContext(\"Instruction format %s not supported\", instruction.getOpcode().format);\n        }\n    }\n\n    @Nonnull\n    private BuilderInstruction10t newBuilderInstruction10t(int codeAddress, int[] codeAddressToIndex,\n                                                           @Nonnull Instruction10t instruction) {\n        return new BuilderInstruction10t(\n                instruction.getOpcode(),\n                newLabel(codeAddressToIndex, codeAddress + instruction.getCodeOffset()));\n    }\n\n    @Nonnull\n    private BuilderInstruction10x newBuilderInstruction10x(@Nonnull Instruction10x instruction) {\n        return new BuilderInstruction10x(\n                instruction.getOpcode());\n    }\n\n    @Nonnull","sourceCodeStart":750,"sourceCodeEnd":786,"githubUrl":"https://github.com/Tencent/tinker/blob/1b7ea02c239840f563ea64fb5bd286eb98d4011e/tinker-build/tinker-patch-lib/src/main/java/org/jf/dexlib2/builder/BuilderMutableMethodImplementation.java#L750-L786","documentation":"ExceptionWithContext from BuilderMutableMethodImplementation's instruction converter: the switch over instruction formats has no case for the format of an instruction being converted into builder form. The bundled dexlib2 simply does not know how to build that format.","triggerScenarios":"A dex contains an instruction whose opcode format is not among the cases handled in newBuilderInstruction (unexpected/unhandled format), hit while Tinker parses the dex for diffing or patching.","commonSituations":"Newer ART instruction formats (from newer AGP/d8 versions or new Dalvik opcodes) not supported by the older dexlib2 that Tinker bundles; dex mutated by instrumentation tools.","solutions":["Upgrade Tinker (and tinker-patch-lib's dexlib2) to a version matching your build toolchain","Pin AGP/d8 to a version whose dex output the Tinker release supports","If you maintain a fork, add the missing format case in BuilderMutableMethodImplementation"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    // dex parse/rewrite\n} catch (org.jf.util.ExceptionWithContext e) {\n    if (String.valueOf(e.getMessage()).contains(\"Instruction format\")) {\n        // dex uses a format unknown to this dexlib2: upgrade toolchain, skip dex\n    } else { throw e; }\n}","preventionTips":["Match Tinker version to your AGP/d8 output format before enabling hotpatch on a build","Add a CI step that runs patch generation against the release dex to catch format gaps early"],"tags":["dexlib2","dex","unsupported-format","version-mismatch","agp"],"backgroundTag":null,"analyzedSha":"1b7ea02c239840f563ea64fb5bd286eb98d4011e","analyzedAt":"2026-08-14T15:16:52.110Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}