iBotPeaches/Apktool · error · AndrolibException

Could not find resources.arsc in file:

Error message

Could not find resources.arsc in file: 

What it means

AndrolibException thrown by Framework.install() (the `apktool if framework.apk` path) when the zip being installed has no resources.arsc entry. Framework installation exists solely to extract and publicize resources.arsc; an APK without one (resources-free app, split with no resources, or a plain jar/zip) cannot become a framework.

Source

Thrown at brut.apktool/apktool-lib/src/main/java/brut/androlib/res/Framework.java:76

            } else {
                defDir = Paths.get(userHome, ".local", "share", "apktool", "framework");
            }
        }
        DEFAULT_DIRECTORY = defDir.toFile();
    }

    private final Config mConfig;
    private File mDirectory;

    public Framework(Config config) {
        mConfig = config;
    }

    public void install(File apkFile) throws AndrolibException {
        try (ZipFile zip = new ZipFile(apkFile)) {
            ZipEntry entry = zip.getEntry("resources.arsc");
            if (entry == null) {
                throw new AndrolibException("Could not find resources.arsc in file: " + apkFile);
            }

            byte[] data = BrutIO.readAndClose(zip.getInputStream(entry));
            ResTable table = parseAndPublicizeResources(data);
            int pkgId = table.listPackageGroups().iterator().next().getId();
            File outFile = new File(getDirectory(), pkgId + getApkSuffix());

            try (ZipOutputStream out = new ZipOutputStream(Files.newOutputStream(outFile.toPath()))) {
                out.setMethod(ZipOutputStream.STORED);
                CRC32 crc = new CRC32();
                crc.update(data);
                entry = new ZipEntry("resources.arsc");
                entry.setSize(data.length);
                entry.setMethod(ZipEntry.STORED);
                entry.setCrc(crc.getValue());
                out.putNextEntry(entry);
                out.write(data);
                out.closeEntry();

View on GitHub (pinned to 79b63384d7)

Solutions

  1. Install the base APK (or the APK that actually contains resources.arsc) instead of a split/config APK.
  2. Verify first: `unzip -l file.apk | grep resources.arsc`.
  3. For vendor frameworks, obtain the correct resources-bearing APK from the device (/system/framework/*.apk or an OTA payload).

Example fix

# before
apktool if split_config.en.apk
# after
unzip -l base.apk | grep resources.arsc   # confirm present
apktool if base.apk
Defensive patterns

Strategy: validation

Validate before calling

try (java.util.zip.ZipFile z = new java.util.zip.ZipFile(apkFile)) {
    if (z.getEntry("resources.arsc") == null) {
        throw new IllegalArgumentException("Not a framework candidate (no resources.arsc): " + apkFile);
    }
}

Try / catch

catch (AndrolibException e) { /* message contains 'Could not find resources.arsc'; pick the base APK instead */ }

Prevention

When it happens

Trigger: Running `apktool if something.apk` where something.apk is a resource-less APK, an APK split that carries no resources.arsc, a dex-only archive, or a renamed zip/jar.

Common situations: Trying to install a vendor split APK (e.g. split_config.*.apk) as a framework; passing the wrong file to `apktool if`; frameworks extracted from system images that keep resources in a separate overlay package.

Related errors


AI-assisted analysis of iBotPeaches/Apktool@79b63384d7 (2026-08-14). Data as JSON: /api/errors/835b5436e27c9659. Report an issue: GitHub.