skylot/jadx · error · JadxArgsValidateException

Input class not found: {}

Error message

Input class not found: {}

What it means

Thrown by CodeAnnotationAdapter.read when deserializing a cached annotation: it reads a 1-byte tag and indexes adaptersByTag[tag]. Tags are assigned 1..N at construction time from the AnnType set the running jadx supports. A tag with no registered adapter (null slot) means the cache byte was written by a jadx build whose AnnType ordering/count differs, or the bytes are corrupt. It is a cache-format/version mismatch, not an application-logic error.

Source

Thrown at jadx-cli/src/main/java/jadx/cli/SingleClassMode.java:37

public class SingleClassMode {
	private static final Logger LOG = LoggerFactory.getLogger(SingleClassMode.class);

	public static boolean process(JadxDecompiler jadx, JadxCLIArgs cliArgs) {
		String singleClass = cliArgs.getSingleClass();
		String singleClassOutput = cliArgs.getSingleClassOutput();
		if (singleClass == null && singleClassOutput == null) {
			return false;
		}
		ClassNode clsForProcess;
		if (singleClass != null) {
			clsForProcess = jadx.getRoot().resolveClass(singleClass);
			if (clsForProcess == null) {
				clsForProcess = jadx.getRoot().getClasses().stream()
						.filter(cls -> cls.getClassInfo().getAliasFullName().equals(singleClass))
						.findFirst().orElse(null);
			}
			if (clsForProcess == null) {
				throw new JadxArgsValidateException("Input class not found: " + singleClass);
			}
			if (clsForProcess.contains(AFlag.DONT_GENERATE)) {
				throw new JadxArgsValidateException("Input class can't be saved by current jadx settings (marked as DONT_GENERATE)");
			}
			if (clsForProcess.isInner()) {
				clsForProcess = clsForProcess.getTopParentClass();
				LOG.warn("Input class is inner, parent class will be saved: {}", clsForProcess.getFullName());
			}
		} else {
			// singleClassOutput is set
			// expect only one class to be loaded
			List<ClassNode> classes = jadx.getRoot().getClasses().stream()
					.filter(c -> !c.isInner() && !c.contains(AFlag.DONT_GENERATE))
					.collect(Collectors.toList());
			int size = classes.size();
			if (size == 1) {
				clsForProcess = classes.get(0);
			} else {

View on GitHub (pinned to e738a26571)

Solutions

  1. Clear the jadx cache directory; the adapter table is rebuilt for the current version on next run.
  2. Pin a single jadx version so cache format stays stable.
  3. Upgrade jadx; newer builds treat an unknown tag as cache-invalidating rather than fatal.
  4. Ensure no two jadx processes write the same cache concurrently.

Example fix

// before
TypeInfo typeInfo = adaptersByTag[tag];
if (typeInfo == null) {
    throw new RuntimeException("Unknown type tag: " + tag);
}

// after
TypeInfo typeInfo = (tag > 0 && tag < adaptersByTag.length) ? adaptersByTag[tag] : null;
if (typeInfo == null) {
    // version skew or corruption: discard this cache and recompute
    throw new CacheInvalidatedException("Unknown type tag: " + tag);
}
Defensive patterns

Strategy: validation

Validate before calling

// Validate the tag range/registration before indexing the adapter table:
TypeInfo typeInfo = (tag > 0 && tag < adaptersByTag.length) ? adaptersByTag[tag] : null;
if (typeInfo == null) {
    // version skew or corruption: invalidate on-disk cache
    invalidateCache();
    return null;
}

Try / catch

try {
    return codeAnnotationAdapter.read(in);
} catch (RuntimeException e) {
    if (e.getMessage() != null && e.getMessage().startsWith("Unknown type tag")) {
        LOG.warn("Cache version mismatch, rebuilding: {}", e.getMessage());
        cacheDir.delete();
        return null;
    }
    throw e;
}

Prevention

When it happens

Trigger: Opening a cache produced by a different jadx version: the AnnType enum registered in registerAdapters() changed (added/removed/reordered), so a tag value written previously now indexes a null slot. Also possible if the cache file is truncated/corrupt so the byte read is garbage.

Common situations: Upgrading or downgrading jadx and reusing an old cache; opening a cache written by a fork with extra AnnTypes; filesystem corruption or a partial write leaving a stray tag byte; concurrent cache writes.

Related errors


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