skylot/jadx · error · JadxRuntimeException

Failed to get call site for insn: {}

Error message

Failed to get call site for insn: {}

What it means

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.

Source

Thrown at jadx-core/src/main/java/jadx/core/dex/instructions/InvokeCustomBuilder.java:26

import jadx.core.dex.attributes.AFlag;
import jadx.core.dex.attributes.AType;
import jadx.core.dex.attributes.nodes.JadxError;
import jadx.core.dex.instructions.invokedynamic.CustomLambdaCall;
import jadx.core.dex.instructions.invokedynamic.CustomRawCall;
import jadx.core.dex.instructions.invokedynamic.CustomStringConcat;
import jadx.core.dex.nodes.InsnNode;
import jadx.core.dex.nodes.MethodNode;
import jadx.core.utils.Utils;
import jadx.core.utils.exceptions.JadxRuntimeException;
import jadx.core.utils.input.InsnDataUtils;

public class InvokeCustomBuilder {

	public static InsnNode build(MethodNode mth, InsnData insn, boolean isRange) {
		try {
			ICallSite callSite = InsnDataUtils.getCallSite(insn);
			if (callSite == null) {
				throw new JadxRuntimeException("Failed to get call site for insn: " + insn);
			}
			callSite.load();
			List<EncodedValue> values = callSite.getValues();
			if (CustomLambdaCall.isLambdaInvoke(values)) {
				return CustomLambdaCall.buildLambdaMethodCall(mth, insn, isRange, values);
			}
			if (CustomStringConcat.isStringConcat(values)) {
				return CustomStringConcat.buildStringConcat(insn, isRange, values);
			}
			try {
				return CustomRawCall.build(mth, insn, isRange, values);
			} catch (Exception e) {
				mth.addWarn("Failed to decode invoke-custom: \n" + Utils.listToString(values, "\n")
						+ ",\n exception: " + Utils.getStackTrace(e));
				InsnNode nop = new InsnNode(InsnType.NOP, 0);
				nop.add(AFlag.SYNTHETIC);
				nop.addAttr(AType.JADX_ERROR, new JadxError("Failed to decode invoke-custom: " + values, e));
				return nop;

View on GitHub (pinned to e738a26571)

Solutions

  1. Upgrade JADX.
  2. Inspect the DEX call_site_ids and method_handles sections with baksmali/dexdump.
  3. Re-extract the APK from a clean source.
  4. Report the invoke-custom site and full trace upstream.
Defensive patterns

Strategy: try-catch

Try / catch

try {
    jadx.load();
} catch (JadxRuntimeException e) {
    if (e.getMessage().contains("Failed to get call site")) {
        log.warn("invoke-custom with unresolved call site", e);
    } else throw e;
}

Prevention

When it happens

Trigger: An invoke-custom instruction whose index type is not CALL_SITE, or whose ICustomPayload / index cannot supply an ICallSite object.

Common situations: 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.

Related errors


AI-assisted analysis of skylot/jadx@e738a26571 (2026-08-14). Data as JSON: /api/errors/11ff139741b3b4c7. Report an issue: GitHub.