{"record":{"id":"835b5436e27c9659","repo":"iBotPeaches/Apktool","slug":"could-not-find-resources-arsc-in-file","errorCode":null,"errorMessage":"Could not find resources.arsc in file: ","messagePattern":"Could not find resources\\.arsc in file: ","errorType":"exception","errorClass":"AndrolibException","httpStatus":null,"severity":"error","filePath":"brut.apktool/apktool-lib/src/main/java/brut/androlib/res/Framework.java","lineNumber":76,"sourceCode":"            } else {\n                defDir = Paths.get(userHome, \".local\", \"share\", \"apktool\", \"framework\");\n            }\n        }\n        DEFAULT_DIRECTORY = defDir.toFile();\n    }\n\n    private final Config mConfig;\n    private File mDirectory;\n\n    public Framework(Config config) {\n        mConfig = config;\n    }\n\n    public void install(File apkFile) throws AndrolibException {\n        try (ZipFile zip = new ZipFile(apkFile)) {\n            ZipEntry entry = zip.getEntry(\"resources.arsc\");\n            if (entry == null) {\n                throw new AndrolibException(\"Could not find resources.arsc in file: \" + apkFile);\n            }\n\n            byte[] data = BrutIO.readAndClose(zip.getInputStream(entry));\n            ResTable table = parseAndPublicizeResources(data);\n            int pkgId = table.listPackageGroups().iterator().next().getId();\n            File outFile = new File(getDirectory(), pkgId + getApkSuffix());\n\n            try (ZipOutputStream out = new ZipOutputStream(Files.newOutputStream(outFile.toPath()))) {\n                out.setMethod(ZipOutputStream.STORED);\n                CRC32 crc = new CRC32();\n                crc.update(data);\n                entry = new ZipEntry(\"resources.arsc\");\n                entry.setSize(data.length);\n                entry.setMethod(ZipEntry.STORED);\n                entry.setCrc(crc.getValue());\n                out.putNextEntry(entry);\n                out.write(data);\n                out.closeEntry();","sourceCodeStart":58,"sourceCodeEnd":94,"githubUrl":"https://github.com/iBotPeaches/Apktool/blob/79b63384d7d7e22917e6ea8b453272da7012515b/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/Framework.java#L58-L94","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Install the base APK (or the APK that actually contains resources.arsc) instead of a split/config APK.","Verify first: `unzip -l file.apk | grep resources.arsc`.","For vendor frameworks, obtain the correct resources-bearing APK from the device (/system/framework/*.apk or an OTA payload)."],"exampleFix":"# before\napktool if split_config.en.apk\n# after\nunzip -l base.apk | grep resources.arsc   # confirm present\napktool if base.apk","handlingStrategy":"validation","validationCode":"try (java.util.zip.ZipFile z = new java.util.zip.ZipFile(apkFile)) {\n    if (z.getEntry(\"resources.arsc\") == null) {\n        throw new IllegalArgumentException(\"Not a framework candidate (no resources.arsc): \" + apkFile);\n    }\n}","typeGuard":null,"tryCatchPattern":"catch (AndrolibException e) { /* message contains 'Could not find resources.arsc'; pick the base APK instead */ }","preventionTips":["Check for resources.arsc with unzip -l before `apktool if`.","Install base APKs, never split_config or dynamic feature splits, as frameworks."],"tags":["apktool","framework","resources-arsc","install"],"backgroundTag":null,"analyzedSha":"79b63384d7d7e22917e6ea8b453272da7012515b","analyzedAt":"2026-08-14T10:43:28.812Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}