skylot/jadx · error · JadxRuntimeException

Unknown container type: {}

Error message

Unknown container type: {}

What it means

RegionUtils.hasExitEdge(IContainer) handles IBlock, IBranchRegion, and IRegion; any other IContainer implementation triggers this. unknownContainerType() formats it as 'Unknown container type: <class>' (or 'Null container variable' for null). This is an internal jadx decompiler invariant: the region graph produced a container node the traversal does not recognize. It indicates a defect in region building or an unusual region subtype, not a user configuration error.

Source

Thrown at jadx-core/src/main/java/jadx/core/utils/RegionUtils.java:60

	public static boolean hasExitEdge(IContainer container) {
		if (container instanceof IBlock) {
			return BlockUtils.containsExitInsn((IBlock) container);
		}
		if (container instanceof IBranchRegion) {
			// all branches must have exit edge
			for (IContainer br : ((IBranchRegion) container).getBranches()) {
				if (br == null || !hasExitEdge(br)) {
					return false;
				}
			}
			return true;
		}
		if (container instanceof IRegion) {
			IContainer last = Utils.last(((IRegion) container).getSubBlocks());
			return last != null && hasExitEdge(last);
		}
		throw new JadxRuntimeException(unknownContainerType(container));
	}

	@Nullable
	public static InsnNode getFirstInsn(IContainer container) {
		if (container instanceof IBlock) {
			IBlock block = (IBlock) container;
			List<InsnNode> insnList = block.getInstructions();
			if (insnList.isEmpty()) {
				return null;
			}
			return insnList.get(0);
		} else if (container instanceof IBranchRegion) {
			return null;
		} else if (container instanceof IRegion) {
			IRegion region = (IRegion) container;
			List<IContainer> blocks = region.getSubBlocks();
			if (blocks.isEmpty()) {
				return null;

View on GitHub (pinned to e738a26571)

Solutions

  1. Report the failing class/method to the jadx issue tracker with the input sample; this is an internal decompiler error.
  2. Upgrade jadx to the latest release (region-handling bugs are fixed frequently).
  3. Skip the failing class via the CLI exclude filter (-e/--single-class on others) to continue decompiling the rest of the APK.
  4. If a plugin introduces a new IContainer subtype, extend RegionUtils or avoid passing it to hasExitEdge.
Defensive patterns

Strategy: try-catch

Type guard

// Narrow to handled container types before calling hasExitEdge.
boolean isHandled = container instanceof IBlock
    || container instanceof IBranchRegion
    || container instanceof IRegion;
// only call when isHandled is true

Try / catch

try {
    boolean exit = RegionUtils.hasExitEdge(container);
} catch (JadxRuntimeException e) {
    LOG.warn("Skipping region, unhandled container type: {}", container.getClass(), e);
    // treat as no-exit / skip method
}

Prevention

When it happens

Trigger: Calling RegionUtils.hasExitEdge(container) on an IContainer that is not IBlock, IBranchRegion, or IRegion (or a null that reached the final throw rather than earlier checks). Encountered during decompilation of a method whose region structure contains an unexpected container type.

Common situations: Decompiling heavily obfuscated or malformed DEX bytecode that yields a region tree jadx does not expect; a jadx version regression in a region-building pass; a custom region type introduced by a plugin but not handled by RegionUtils.

Related errors


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