skylot/jadx · error · JadxRuntimeException
Can't find block by offset: {} in list {}
Error message
Can't find block by offset: {} in list {} What it means
Thrown by BlockUtils.getBlockByOffset when no block in the supplied casesBlocks iterable has a start offset equal to the requested offset. It is a linear-scan lookup helper used by IfNode/SwitchInsn to resolve branch targets against the method's successors list during block-graph construction. Failure means a branch/case target offset is not present in the expected block list.
Source
Thrown at jadx-core/src/main/java/jadx/core/utils/BlockUtils.java:57
import jadx.core.dex.regions.conditions.IfCondition;
import jadx.core.dex.trycatch.CatchAttr;
import jadx.core.dex.trycatch.ExceptionHandler;
import jadx.core.utils.blocks.BlockSet;
import jadx.core.utils.blocks.DFSIteration;
import jadx.core.utils.exceptions.JadxRuntimeException;
public class BlockUtils {
private BlockUtils() {
}
public static BlockNode getBlockByOffset(int offset, Iterable<BlockNode> casesBlocks) {
for (BlockNode block : casesBlocks) {
if (block.getStartOffset() == offset) {
return block;
}
}
throw new JadxRuntimeException("Can't find block by offset: "
+ InsnUtils.formatOffset(offset)
+ " in list " + casesBlocks);
}
public static BlockNode selectOther(BlockNode node, List<BlockNode> blocks) {
List<BlockNode> list = blocks;
if (list.size() > 2) {
list = cleanBlockList(list);
}
if (list.size() != 2) {
throw new JadxRuntimeException("Incorrect nodes count for selectOther: " + node + " in " + list);
}
BlockNode first = list.get(0);
if (first != node) {
return first;
} else {
return list.get(1);
}View on GitHub (pinned to e738a26571)
Solutions
- Update jadx; offset/successor collection is fixed regularly.
- Report the input plus the offset and block list from the message.
- Skip the affected class and continue the batch.
- Catch JadxRuntimeException per class/method when using jadx as a library.
Defensive patterns
Strategy: try-catch
Try / catch
try {
BlockNode b = BlockUtils.getBlockByOffset(off, blocks);
} catch (JadxRuntimeException e) {
LOG.warn("offset {} not in block list, skipping", off, e);
} Prevention
- Update jadx; branch-target/successor collection fixes land regularly.
- Report the input with the offset and list from the message.
- Catch per method to keep batch decompilation resilient.
When it happens
Trigger: Building the block graph for an if-instruction (IfNode) or a switch (SwitchInsn) where the branch target offset does not match the startOffset() of any block in the instruction's successors list - e.g. a target that points into the middle of another block, or successors that were not collected correctly.
Common situations: Malformed DEX with branch targets into the middle of instructions, multi-dex inputs with mis-aligned code offsets, or a jadx bug in successor collection. Rare on valid bytecode; common on hand-edited or packed inputs.
Related errors
- Incorrect nodes count for selectOther: {} in {}
- Failed to find top block for try-catch from: {}
- Unreachable block: {}
- Copy blocks tree failed. Missing block for connection: {}
- Unexpected missing predecessor for block: {}
AI-assisted analysis of skylot/jadx@e738a26571 (2026-08-14).
Data as JSON: /api/errors/491255d776b3dc3b.
Report an issue: GitHub.