skylot/jadx · error · JadxRuntimeException

Unknown type of resource file: ${resFile.getOriginalName()}

Error message

Unknown type of resource file: ${resFile.getOriginalName()}

What it means

Thrown by ResourcesLoader.decodeTable() when iterating all registered IResTableParserProviders yields no non-null parser for the given ARSC ResourceFile. decodeTable() first asserts the type is ARSC, then asks each provider.getParser(resFile); if none returns a parser, jadx has no way to parse that resource table and throws a JadxRuntimeException naming the file. This usually indicates a missing or disabled ARSC provider.

Source

Thrown at jadx-core/src/main/java/jadx/api/ResourcesLoader.java:162

			default:
				return ResContainer.resourceFileLink(resFile);
		}
	}

	public IResTableParser decodeTable(ResourceFile resFile, InputStream is) throws IOException {
		if (resFile.getType() != ResourceType.ARSC) {
			throw new IllegalArgumentException("Unexpected resource type for decode: " + resFile.getType() + ", expect '.pb'/'.arsc'");
		}
		IResTableParser parser = null;
		for (IResTableParserProvider provider : resTableParserProviders) {
			parser = provider.getParser(resFile);
			if (parser != null) {
				break;
			}
		}
		if (parser == null) {
			throw new JadxRuntimeException("Unknown type of resource file: " + resFile.getOriginalName());
		}
		parser.setBaseFileName(resFile.getDeobfName());
		parser.decode(is);
		return parser;
	}

	private static ResContainer decodeImage(ResourceFile rf, InputStream inputStream) {
		String name = rf.getDeobfName();
		if (name.endsWith(".9.png")) {
			try (ByteArrayOutputStream os = new ByteArrayOutputStream()) {
				Res9patchStreamDecoder decoder = new Res9patchStreamDecoder();
				if (decoder.decode(inputStream, os)) {
					return ResContainer.decodedData(rf.getDeobfName(), os.toByteArray());
				}
			} catch (Exception e) {
				LOG.error("Failed to decode 9-patch png image, path: {}", name, e);
			}
		}

View on GitHub (pinned to e738a26571)

Solutions

  1. Ensure the Android resource modules (providing the ARSC/protobuf table parsers) are on the classpath.
  2. Register an IResTableParserProvider that handles the specific format (.arsc vs .pb) of your file.
  3. Confirm resFile.getType() is actually ARSC before calling decodeTable().
  4. If you ship a custom provider, verify its getParser() returns a parser for the formats you need.

Example fix

// before
IResTableParser parser = resLoader.decodeTable(resFile, is);

// after
if (resFile.getType() != ResourceType.ARSC
        || resTableParserProviders.stream().noneMatch(p -> p.getParser(resFile) != null)) {
    LOG.warn("No ARSC parser available for {}, skipping", resFile.getOriginalName());
    return;
}
IResTableParser parser = resLoader.decodeTable(resFile, is);
Defensive patterns

Strategy: validation

Validate before calling

// Before calling decodeTable, confirm a provider can handle this ARSC file.
if (resFile.getType() != ResourceType.ARSC) {
    throw new IllegalArgumentException("Not an ARSC resource: " + resFile);
}
boolean hasParser = resTableParserProviders.stream()
        .anyMatch(p -> p.getParser(resFile) != null);
if (!hasParser) {
    LOG.warn("No registered parser for ARSC file {}, skipping", resFile.getOriginalName());
    return;
}

Try / catch

try {
    parser = resLoader.decodeTable(resFile, is);
} catch (JadxRuntimeException e) {
    if (e.getMessage().startsWith("Unknown type of resource file")) {
        LOG.warn("No ARSC parser provider for {}", resFile.getOriginalName());
        return;
    }
    throw e;
}

Prevention

When it happens

Trigger: Calling decodeTable() on a ResourceFile of type ARSC (a .arsc or .pb table) when no registered IResTableParserProvider.getParser() returns a non-null parser for it.

Common situations: The Android resource table provider plugin is not on the classpath (jadx-core without the Android modules); a provider that only handles legacy .arsc but the file is the newer protobuf .pb format (or vice versa); a custom setup that removed the default providers; a provider whose getParser incorrectly returns null for a supported format.

Related errors


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