{"record":{"id":"daf05c6eb095e64a","repo":"skylot/jadx","slug":"can-t-build-insn-arg-from-encoded-value","errorCode":null,"errorMessage":"Can't build insn arg from encoded value: {}","messagePattern":"Can't build insn arg from encoded value: (.+?)","errorType":"exception","errorClass":"JadxRuntimeException","httpStatus":null,"severity":"error","filePath":"jadx-core/src/main/java/jadx/core/dex/instructions/invokedynamic/CustomStringConcat.java","lineNumber":115,"sourceCode":"\t\t\tconcat.addArg(InsnArg.wrapArg(new ConstStringNode(sb.toString())));\n\t\t}\n\t}\n\n\tprivate static InsnArg buildInsnArgFromEncodedValue(EncodedValue encodedValue) {\n\t\tObject value = EncodedValueUtils.convertToConstValue(encodedValue);\n\t\tif (value == null) {\n\t\t\treturn InsnArg.lit(0, ArgType.UNKNOWN);\n\t\t}\n\t\tif (value instanceof LiteralArg) {\n\t\t\treturn ((LiteralArg) value);\n\t\t}\n\t\tif (value instanceof ArgType) {\n\t\t\treturn InsnArg.wrapArg(new ConstClassNode((ArgType) value));\n\t\t}\n\t\tif (value instanceof String) {\n\t\t\treturn InsnArg.wrapArg(new ConstStringNode(((String) value)));\n\t\t}\n\t\tthrow new JadxRuntimeException(\"Can't build insn arg from encoded value: \" + encodedValue);\n\t}\n}\n","sourceCodeStart":97,"sourceCodeEnd":118,"githubUrl":"https://github.com/skylot/jadx/blob/e738a26571d02919f01df40de93bc9a44dee4e18/jadx-core/src/main/java/jadx/core/dex/instructions/invokedynamic/CustomStringConcat.java#L97-L118","documentation":"In CustomStringConcat.buildInsnArgFromEncodedValue(), the converted constant value is not null, not a LiteralArg, not an ArgType, and not a String. The StringConcatFactory recipe constant cannot be turned into an instruction argument because its type is unrecognized.","triggerScenarios":"A StringConcatFactory bootstrap call whose recipe constant value (beyond index 3) is an unexpected EncodedValue type — e.g. an enum, array, annotation, or byte/short value that EncodedValueUtils.convertToConstValue returns as an unsupported object.","commonSituations":"Non-standard string concatenation recipes, obfuscated or packed makeConcatWithConstants sites, or a DEX produced by a toolchain with unusual encoded constants.","solutions":["Upgrade JADX.","Inspect the StringConcatFactory recipe and its constant values with baksmali.","Use --show-bad-code to continue past the failing site.","Report the encoded value type upstream."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":"// Narrow the converted value to the supported set before building an arg.\nObject v = EncodedValueUtils.convertToConstValue(encodedValue);\nboolean buildable = v == null || v instanceof LiteralArg || v instanceof ArgType || v instanceof String;","tryCatchPattern":"try {\n    jadx.load();\n} catch (JadxRuntimeException e) {\n    if (e.getMessage().contains(\"Can't build insn arg from encoded value\")) {\n        log.warn(\"Unsupported constant in StringConcatFactory recipe\", e);\n    } else throw e;\n}","preventionTips":["Inspect makeConcatWithConstants recipe constants with baksmali.","Use --show-bad-code to continue past unsupported concat constants.","Keep JADX updated."],"tags":["string-concat","invoke-custom","encoded-value","malformed-input"],"backgroundTag":null,"analyzedSha":"e738a26571d02919f01df40de93bc9a44dee4e18","analyzedAt":"2026-08-14T00:10:24.238Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}