iBotPeaches/Apktool · error · AndrolibException
Could not find resources.arsc in file: {apkFile}
Error message
Could not find resources.arsc in file: {apkFile} What it means
AndrolibException thrown by ResTable.loadPackagesFromApk() when the opened zip directory does not contain a resources.arsc entry. That entry is the compiled resource table and is mandatory for loading a package; its absence means the zip is not a resource-bearing APK from the parser's perspective (even though the zip itself opened fine).
Source
Thrown at brut.apktool/apktool-lib/src/main/java/brut/androlib/res/table/ResTable.java:122
// Empty resources.arsc, create a dummy package group.
pkgGroup = new ResPackageGroup(this, 0, "");
mPackageGroups.put(0, pkgGroup);
} else if (mPackageGroups.containsKey(APP_PACKAGE_ID)) {
// Prefer the standard app package group.
pkgGroup = mPackageGroups.get(APP_PACKAGE_ID);
} else {
// Fall back to the first package group in the table.
pkgGroup = mPackageGroups.values().iterator().next();
}
mMainPackage = pkgGroup.getBasePackage();
}
private void loadPackagesFromApk(File apkFile, ZipRODirectory zipDir, boolean isMainPackage)
throws AndrolibException {
try {
if (!zipDir.containsFile("resources.arsc")) {
throw new AndrolibException("Could not find resources.arsc in file: " + apkFile);
}
try (InputStream in = zipDir.getFileInput("resources.arsc")) {
BinaryResourceParser parser = isMainPackage
? new BinaryResourceParser(this, mConfig.isKeepBrokenResources(), mConfig.isDecodeResolveGreedy())
: new BinaryResourceParser(this, true, true);
parser.parse(in);
// Only flag the app for the main package.
if (isMainPackage) {
if (parser.hasSparseEntries()) {
mApkInfo.getResourcesInfo().setSparseEntries(true);
}
if (parser.hasCompactEntries()) {
mApkInfo.getResourcesInfo().setCompactEntries(true);
}
}
}View on GitHub (pinned to 79b63384d7)
Solutions
- Load the base APK (the split containing AndroidManifest.xml and resources.arsc), not a feature split.
- If processing a bundle, extract it and select the APK whose zip listing shows resources.arsc (unzip -l base.apk | grep resources.arsc).
- If the app genuinely has no compiled resources, skip ResTable loading for that file rather than erroring.
- Catch AndrolibException from load() and check the message to distinguish 'no arsc' from 'cannot open zip' (error 58).
Example fix
// before
resTable.load(); // throws on arsc-less splits
// after
if (zipDir.containsFile("resources.arsc")) {
resTable.load();
} else {
Log.i(TAG, apkPath + " has no resources.arsc; skipping resource table load");
} Defensive patterns
Strategy: validation
Validate before calling
// Verify resources.arsc presence before loading the table
ZipRODirectory zipDir = (ZipRODirectory) apkInfo.getApkFile().getDirectory();
if (!zipDir.containsFile("resources.arsc")) {
Log.i(TAG, "No resources.arsc in " + apkPath + "; skipping resource table");
return;
} Try / catch
try {
resTable.load();
} catch (AndrolibException ex) {
if (String.valueOf(ex.getMessage()).contains("Could not find resources.arsc")) {
// wrong APK (split without resources) -> load the base APK instead
}
} Prevention
- Always pass the base APK (with AndroidManifest.xml + resources.arsc) for resource loading
- When handling app bundles, locate the split containing resources.arsc programmatically
- Check containsFile("resources.arsc") before invoking ResTable.load()
When it happens
Trigger: Loading a zip/apk that has no resources.arsc: plain jars, some native-library splits, asset-only APKs, or split APKs where resources live only in the base; renamed arsc entries after repackaging; APKs stripped by size optimizers.
Common situations: Pointing the decoder at a config split or native split instead of the base APK; .jar/.zip inputs; apps minified with tools that drop resources.arsc when the app is resource-free.
Related errors
- Could not open apk file: {apkFile}
- Could not load resources.arsc from file: {apkFile}
- Legacy aapt is no longer supported.
- Could not find resources.arsc in file:
- No packages in resources.arsc in file.
AI-assisted analysis of iBotPeaches/Apktool@79b63384d7 (2026-08-14).
Data as JSON: /api/errors/f5271ebee0b23955.
Report an issue: GitHub.