{"record":{"id":"691976943c8ace92","repo":"iBotPeaches/Apktool","slug":"no-packages-in-resources-arsc-in-file","errorCode":null,"errorMessage":"No packages in resources.arsc in file.","messagePattern":"No packages in 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":124,"sourceCode":"                    out.write(manifest);\n                    out.closeEntry();\n                }\n            }\n\n            Log.i(TAG, \"Framework installed to: \" + outFile);\n        } catch (IOException ex) {\n            throw new AndrolibException(ex);\n        }\n    }\n\n    private ResTable parseAndPublicizeResources(byte[] data) throws AndrolibException {\n        ResTable table = new ResTable(new ApkInfo(), mConfig);\n        BinaryResourceParser parser = new BinaryResourceParser(table, true, true);\n        parser.enableCollectFlagsOffsets();\n        parser.parse(new ByteArrayInputStream(data));\n\n        if (table.getPackageGroupCount() == 0) {\n            throw new AndrolibException(\"No packages in resources.arsc in file.\");\n        }\n\n        // Publicize all entry specs.\n        ByteBuffer buffer = ByteBuffer.wrap(data).order(ByteOrder.LITTLE_ENDIAN);\n        for (Pair<Long, Integer> pair : parser.getEntrySpecFlagsOffsets()) {\n            int position = pair.getLeft().intValue();\n            int count = pair.getRight();\n            for (int i = 0; i < count; i++, position += 4) {\n                int flags = buffer.getInt(position);\n                buffer.putInt(position, flags | 0x40000000); // ResTable_typeSpec::SPEC_PUBLIC\n            }\n        }\n\n        return table;\n    }\n\n    public File getDirectory() throws AndrolibException {\n        if (mDirectory == null) {","sourceCodeStart":106,"sourceCodeEnd":142,"githubUrl":"https://github.com/iBotPeaches/Apktool/blob/79b63384d7d7e22917e6ea8b453272da7012515b/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/Framework.java#L106-L142","documentation":"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.","triggerScenarios":"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.","commonSituations":"Corrupted download of a framework APK; resources.arsc replaced by optimizers/protectors; partial file transfer (truncated zip entry).","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."],"exampleFix":"# before\napktool if possibly_corrupt-framework.apk\n# after\nunzip -t framework.apk        # must report no errors\napktool if framework.apk","handlingStrategy":"try-catch","validationCode":"try (ZipFile z = new ZipFile(apkFile)) {\n    ZipEntry e = z.getEntry(\"resources.arsc\");\n    if (e == null || e.getSize() <= 12) {\n        throw new IllegalArgumentException(\"resources.arsc missing or suspiciously small\");\n    }\n}","typeGuard":null,"tryCatchPattern":"try { framework.install(apk); } catch (AndrolibException e) { if (e.getMessage().contains(\"No packages\")) { /* re-pull framework APK, verify checksums */ } else throw e; }","preventionTips":["Validate zip integrity (unzip -t) before installing frameworks.","Keep known-good checksums of framework APKs pulled from devices."],"tags":["apktool","framework","resources-arsc","corruption"],"backgroundTag":null,"analyzedSha":"79b63384d7d7e22917e6ea8b453272da7012515b","analyzedAt":"2026-08-14T10:43:28.812Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}