{"record":{"id":"3ab886718261d228","repo":"iBotPeaches/Apktool","slug":"framework-path-is-not-a-directory","errorCode":null,"errorMessage":"Framework path is not a directory: ","messagePattern":"Framework path is not a directory: ","errorType":"exception","errorClass":"AndrolibException","httpStatus":null,"severity":"error","filePath":"brut.apktool/apktool-lib/src/main/java/brut/androlib/res/Framework.java","lineNumber":147,"sourceCode":"        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) {\n            String path = mConfig.getFrameworkDirectory();\n            File dir = (path != null && !path.isEmpty()) ? new File(path) : DEFAULT_DIRECTORY;\n\n            if (dir.exists() && !dir.isDirectory()) {\n                throw new AndrolibException(\"Framework path is not a directory: \" + dir);\n            }\n\n            File parent = dir.getParentFile();\n            if (parent != null && parent.exists() && !parent.isDirectory()) {\n                throw new AndrolibException(\"Framework path's parent is not a directory: \" + parent);\n            }\n\n            if (!dir.exists() && !dir.mkdirs()) {\n                throw new AndrolibException(\"Could not create framework directory: \" + dir);\n            }\n\n            mDirectory = dir;\n        }\n\n        return mDirectory;\n    }\n\n    public File getApkFile(int id) throws AndrolibException {","sourceCodeStart":129,"sourceCodeEnd":165,"githubUrl":"https://github.com/iBotPeaches/Apktool/blob/79b63384d7d7e22917e6ea8b453272da7012515b/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/Framework.java#L129-L165","documentation":"AndrolibException from Framework.getDirectory() when the configured framework path exists but is not a directory (it is a regular file). The framework directory (default 1.apk, 2.apk... storage) is resolved lazily on first framework use; a file squatting on that path makes storing framework APKs impossible, so apktool aborts rather than overwrite it.","triggerScenarios":"Setting a framework path (-p / --frame-path or Config.setFrameworkDirectory) that points at an existing file; creating a file named exactly like the intended framework dir; default location occupied by a file.","commonSituations":"Typos such as `--frame-path ~/apktool-framework` where that name is an existing file; scripts that touch a lockfile with the same name as the directory; a previous failed run leaving a file instead of a dir.","solutions":["Remove or rename the file at that path: `rm <path>` (after confirming it is not needed).","Point --frame-path at a real (or not-yet-existing) directory.","Check the path: `ls -ld <path>` should show 'd' or 'No such file'."],"exampleFix":"# before\napktool if fw.apk --frame-path ./fw   # ./fw is a file\n# after\nrm ./fw\napktool if fw.apk --frame-path ./fw","handlingStrategy":"validation","validationCode":"File dir = new File(framePath);\nif (dir.exists() && !dir.isDirectory()) {\n    throw new IllegalStateException(\"Framework path occupied by a file: \" + dir);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Bootstrap framework paths with mkdir -p in setup scripts.","Never create lock/log files with the same name as the framework directory."],"tags":["apktool","framework","filesystem","config"],"backgroundTag":null,"analyzedSha":"79b63384d7d7e22917e6ea8b453272da7012515b","analyzedAt":"2026-08-14T10:43:28.812Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}