{"record":{"id":"48b88098df139134","repo":"iBotPeaches/Apktool","slug":"framework-path-s-parent-is-not-a-directory","errorCode":null,"errorMessage":"Framework path's parent is not a directory: ","messagePattern":"Framework path's parent 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":152,"sourceCode":"                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 {\n        return getApkFile(id, mConfig.getFrameworkTag());\n    }\n\n    public File getApkFile(int id, String tag) throws AndrolibException {\n        File dir = getDirectory();","sourceCodeStart":134,"sourceCodeEnd":170,"githubUrl":"https://github.com/iBotPeaches/Apktool/blob/79b63384d7d7e22917e6ea8b453272da7012515b/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/Framework.java#L134-L170","documentation":"AndrolibException from Framework.getDirectory() when the parent of the configured framework path exists but is not a directory. Because the framework dir may need to be created with mkdirs(), apktool first validates that the parent chain is sane; a regular file where a parent directory should be (e.g. /path/to/file/subdir where 'file' is a file) makes creation impossible and aborts with the offending parent path.","triggerScenarios":"Configuring --frame-path /a/b/c when /a/b is an existing regular file; deep framework paths where an intermediate component collides with a filename.","commonSituations":"Nested paths like --frame-path ~/tools where tools is a tarball or script; misordered setup scripts that create files before directories; typos where a path component was meant to be a directory.","solutions":["Inspect the parent path with `ls -ld <parent>` and remove/rename the offending file.","Choose a framework path whose ancestors are all directories (or nonexistent).","Fix setup scripts to mkdir -p the full framework path before running apktool."],"exampleFix":"# before\n--frame-path /opt/tools/frame   # /opt/tools is a file\n# after\nmv /opt/tools /opt/tools.bak && mkdir -p /opt/tools/frame\n--frame-path /opt/tools/frame","handlingStrategy":"validation","validationCode":"File dir = new File(framePath).getAbsoluteFile();\nfor (File p = dir.getParentFile(); p != null; p = p.getParentFile()) {\n    if (p.exists() && !p.isDirectory()) {\n        throw new IllegalStateException(\"Ancestor is a file: \" + p);\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use mkdir -p on the full framework path before running apktool.","Prefer short, dedicated framework paths (~/apktool-framework) over deep nested ones."],"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"}