skylot/jadx · error · JadxRuntimeException

Can't build insn arg from encoded value

Error message

Can't build insn arg from encoded value: {}

What it means

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.

Solutions

  1. Upgrade JADX.
  2. Inspect the StringConcatFactory recipe and its constant values with baksmali.
  3. Use --show-bad-code to continue past the failing site.
  4. Report the encoded value type upstream.
Defensive patterns

Strategy: try-catch

Type guard

// Narrow the converted value to the supported set before building an arg.
Object v = EncodedValueUtils.convertToConstValue(encodedValue);
boolean buildable = v == null || v instanceof LiteralArg || v instanceof ArgType || v instanceof String;

Try / catch

try {
    jadx.load();
} catch (JadxRuntimeException e) {
    if (e.getMessage().contains("Can't build insn arg from encoded value")) {
        log.warn("Unsupported constant in StringConcatFactory recipe", e);
    } else throw e;
}

Prevention

When it happens

Trigger: 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.

Common situations: Non-standard string concatenation recipes, obfuscated or packed makeConcatWithConstants sites, or a DEX produced by a toolchain with unusual encoded constants.

Related errors


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

Appendix: source

Thrown at jadx-core/src/main/java/jadx/core/dex/instructions/invokedynamic/CustomStringConcat.java:115

			concat.addArg(InsnArg.wrapArg(new ConstStringNode(sb.toString())));
		}
	}

	private static InsnArg buildInsnArgFromEncodedValue(EncodedValue encodedValue) {
		Object value = EncodedValueUtils.convertToConstValue(encodedValue);
		if (value == null) {
			return InsnArg.lit(0, ArgType.UNKNOWN);
		}
		if (value instanceof LiteralArg) {
			return ((LiteralArg) value);
		}
		if (value instanceof ArgType) {
			return InsnArg.wrapArg(new ConstClassNode((ArgType) value));
		}
		if (value instanceof String) {
			return InsnArg.wrapArg(new ConstStringNode(((String) value)));
		}
		throw new JadxRuntimeException("Can't build insn arg from encoded value: " + encodedValue);
	}
}

View on GitHub (pinned to e738a26571)