{"record":{"id":"11ff139741b3b4c7","repo":"skylot/jadx","slug":"failed-to-get-call-site-for-insn","errorCode":null,"errorMessage":"Failed to get call site for insn: {}","messagePattern":"Failed to get call site for insn: (.+?)","errorType":"exception","errorClass":"JadxRuntimeException","httpStatus":null,"severity":"error","filePath":"jadx-core/src/main/java/jadx/core/dex/instructions/InvokeCustomBuilder.java","lineNumber":26,"sourceCode":"import jadx.core.dex.attributes.AFlag;\nimport jadx.core.dex.attributes.AType;\nimport jadx.core.dex.attributes.nodes.JadxError;\nimport jadx.core.dex.instructions.invokedynamic.CustomLambdaCall;\nimport jadx.core.dex.instructions.invokedynamic.CustomRawCall;\nimport jadx.core.dex.instructions.invokedynamic.CustomStringConcat;\nimport jadx.core.dex.nodes.InsnNode;\nimport jadx.core.dex.nodes.MethodNode;\nimport jadx.core.utils.Utils;\nimport jadx.core.utils.exceptions.JadxRuntimeException;\nimport jadx.core.utils.input.InsnDataUtils;\n\npublic class InvokeCustomBuilder {\n\n\tpublic static InsnNode build(MethodNode mth, InsnData insn, boolean isRange) {\n\t\ttry {\n\t\t\tICallSite callSite = InsnDataUtils.getCallSite(insn);\n\t\t\tif (callSite == null) {\n\t\t\t\tthrow new JadxRuntimeException(\"Failed to get call site for insn: \" + insn);\n\t\t\t}\n\t\t\tcallSite.load();\n\t\t\tList<EncodedValue> values = callSite.getValues();\n\t\t\tif (CustomLambdaCall.isLambdaInvoke(values)) {\n\t\t\t\treturn CustomLambdaCall.buildLambdaMethodCall(mth, insn, isRange, values);\n\t\t\t}\n\t\t\tif (CustomStringConcat.isStringConcat(values)) {\n\t\t\t\treturn CustomStringConcat.buildStringConcat(insn, isRange, values);\n\t\t\t}\n\t\t\ttry {\n\t\t\t\treturn CustomRawCall.build(mth, insn, isRange, values);\n\t\t\t} catch (Exception e) {\n\t\t\t\tmth.addWarn(\"Failed to decode invoke-custom: \\n\" + Utils.listToString(values, \"\\n\")\n\t\t\t\t\t\t+ \",\\n exception: \" + Utils.getStackTrace(e));\n\t\t\t\tInsnNode nop = new InsnNode(InsnType.NOP, 0);\n\t\t\t\tnop.add(AFlag.SYNTHETIC);\n\t\t\t\tnop.addAttr(AType.JADX_ERROR, new JadxError(\"Failed to decode invoke-custom: \" + values, e));\n\t\t\t\treturn nop;","sourceCodeStart":8,"sourceCodeEnd":44,"githubUrl":"https://github.com/skylot/jadx/blob/e738a26571d02919f01df40de93bc9a44dee4e18/jadx-core/src/main/java/jadx/core/dex/instructions/InvokeCustomBuilder.java#L8-L44","documentation":"In InvokeCustomBuilder.build(), InsnDataUtils.getCallSite(insn) returned null. getCallSite returns null when insn.getIndexType() is not CALL_SITE or no call-site payload is available. An invoke-custom instruction requires a call site, so null is fatal.","triggerScenarios":"An invoke-custom instruction whose index type is not CALL_SITE, or whose ICustomPayload / index cannot supply an ICallSite object.","commonSituations":"Corrupt DEX call_site_ids table, obfuscators that damage invoke-custom sites, or a DEX produced by a toolchain that emits malformed bootstrap method tables.","solutions":["Upgrade JADX.","Inspect the DEX call_site_ids and method_handles sections with baksmali/dexdump.","Re-extract the APK from a clean source.","Report the invoke-custom site and full trace upstream."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    jadx.load();\n} catch (JadxRuntimeException e) {\n    if (e.getMessage().contains(\"Failed to get call site\")) {\n        log.warn(\"invoke-custom with unresolved call site\", e);\n    } else throw e;\n}","preventionTips":["Validate the DEX call_site_ids and bootstrap method tables with baksmali.","Wrap decompilation in try/catch per class.","Keep JADX updated for invoke-custom improvements."],"tags":["invoke-custom","call-site","malformed-input"],"backgroundTag":null,"analyzedSha":"e738a26571d02919f01df40de93bc9a44dee4e18","analyzedAt":"2026-08-14T00:10:24.238Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}