iBotPeaches/Apktool · error · AndrolibException
No packages in resources.arsc in file.
Error message
No packages in resources.arsc in file.
What it means
AndrolibException from Framework.parseAndPublicizeResources() when the resources.arsc in the framework being installed parses to a ResTable with zero package groups. Every valid resources.arsc must contain at least one package chunk; an empty or structurally invalid table (wrong endianness assumptions, truncated file, or a decoy entry) yields no packages and cannot be installed as a framework because the package id (e.g. 1 for android, others for OEMs) is unobtainable.
Source
Thrown at brut.apktool/apktool-lib/src/main/java/brut/androlib/res/Framework.java:124
out.write(manifest);
out.closeEntry();
}
}
Log.i(TAG, "Framework installed to: " + outFile);
} catch (IOException ex) {
throw new AndrolibException(ex);
}
}
private ResTable parseAndPublicizeResources(byte[] data) throws AndrolibException {
ResTable table = new ResTable(new ApkInfo(), mConfig);
BinaryResourceParser parser = new BinaryResourceParser(table, true, true);
parser.enableCollectFlagsOffsets();
parser.parse(new ByteArrayInputStream(data));
if (table.getPackageGroupCount() == 0) {
throw new AndrolibException("No packages in resources.arsc in file.");
}
// Publicize all entry specs.
ByteBuffer buffer = ByteBuffer.wrap(data).order(ByteOrder.LITTLE_ENDIAN);
for (Pair<Long, Integer> pair : parser.getEntrySpecFlagsOffsets()) {
int position = pair.getLeft().intValue();
int count = pair.getRight();
for (int i = 0; i < count; i++, position += 4) {
int flags = buffer.getInt(position);
buffer.putInt(position, flags | 0x40000000); // ResTable_typeSpec::SPEC_PUBLIC
}
}
return table;
}
public File getDirectory() throws AndrolibException {
if (mDirectory == null) {View on GitHub (pinned to 79b63384d7)
Solutions
- Re-download or re-pull the framework APK from a trusted source and retry `apktool if`.
- Verify integrity: `unzip -t file.apk` and compare checksums against the original.
- If extracting from a device, re-pull with adb pull and confirm file size matches ls -l on device.
Example fix
# before apktool if possibly_corrupt-framework.apk # after unzip -t framework.apk # must report no errors apktool if framework.apk
Defensive patterns
Strategy: try-catch
Validate before calling
try (ZipFile z = new ZipFile(apkFile)) {
ZipEntry e = z.getEntry("resources.arsc");
if (e == null || e.getSize() <= 12) {
throw new IllegalArgumentException("resources.arsc missing or suspiciously small");
}
} Try / catch
try { framework.install(apk); } catch (AndrolibException e) { if (e.getMessage().contains("No packages")) { /* re-pull framework APK, verify checksums */ } else throw e; } Prevention
- Validate zip integrity (unzip -t) before installing frameworks.
- Keep known-good checksums of framework APKs pulled from devices.
When it happens
Trigger: Running `apktool if x.apk` where x.apk contains a resources.arsc that is empty, truncated, corrupt, or contains no RES_TABLE_TYPE_PACKAGE chunks; feeding a file whose resources.arsc was stripped/replaced.
Common situations: Corrupted download of a framework APK; resources.arsc replaced by optimizers/protectors; partial file transfer (truncated zip entry).
Related errors
- Could not find resources.arsc in file:
- Repeated package group: id=0x%02x, name=%s
- Framework path is not a directory:
- Framework path's parent is not a directory:
- Could not create framework directory:
AI-assisted analysis of iBotPeaches/Apktool@79b63384d7 (2026-08-14).
Data as JSON: /api/errors/691976943c8ace92.
Report an issue: GitHub.