{"record":{"id":"8624df57c79484bb","repo":"skylot/jadx","slug":"file-not-found-file-getabsolutepath","errorCode":null,"errorMessage":"File not found ${file.getAbsolutePath()}","messagePattern":"File not found (.+?)","errorType":"validation","errorClass":"JadxArgsValidateException","httpStatus":null,"severity":"error","filePath":"jadx-core/src/main/java/jadx/api/JadxArgsValidator.java","lineNumber":84,"sourceCode":"\t\tif (inputFiles.isEmpty()) {\n\t\t\toutDirName = JadxArgs.DEFAULT_OUT_DIR;\n\t\t} else {\n\t\t\tFile file = inputFiles.get(0);\n\t\t\tString name = file.getName();\n\t\t\tint pos = name.lastIndexOf('.');\n\t\t\tif (pos != -1) {\n\t\t\t\toutDirName = name.substring(0, pos);\n\t\t\t} else {\n\t\t\t\toutDirName = name + '-' + JadxArgs.DEFAULT_OUT_DIR;\n\t\t\t}\n\t\t}\n\t\tLOG.info(\"output directory: {}\", outDirName);\n\t\treturn new File(outDirName);\n\t}\n\n\tprivate static void checkFile(File file) {\n\t\tif (!file.exists()) {\n\t\t\tthrow new JadxArgsValidateException(\"File not found \" + file.getAbsolutePath());\n\t\t}\n\t}\n\n\tprivate static void checkDir(File dir, String desc) {\n\t\tif (dir != null && dir.exists() && !dir.isDirectory()) {\n\t\t\tthrow new JadxArgsValidateException(desc + \" directory exists as file \" + dir);\n\t\t}\n\t}\n\n\tprivate JadxArgsValidator() {\n\t}\n}\n","sourceCodeStart":66,"sourceCodeEnd":97,"githubUrl":"https://github.com/skylot/jadx/blob/e738a26571d02919f01df40de93bc9a44dee4e18/jadx-core/src/main/java/jadx/api/JadxArgsValidator.java#L66-L97","documentation":"An argument-validation error from JadxArgsValidator.checkFile(), invoked for every file in args.getInputFiles(). If !file.exists(), jadx cannot read it and throws JadxArgsValidateException with the absolute path. This runs during initialization, before the zip is ever opened.","triggerScenarios":"Passing an input file path that does not exist on disk to JadxArgs.setInputFiles(); a typo, a relative path resolved against an unexpected working directory, or a file that was deleted between selection and load.","commonSituations":"Relative paths resolved from a different CWD than expected in a CLI or service; a build artifact referenced before it was produced; a moved/deleted APK; containerized runs where the file is not mounted into the expected path.","solutions":["Verify the absolute path printed in the message exists on the filesystem.","Use absolute paths or resolve relative paths against a known base directory.","In containers, confirm the file is mounted/copied to the path jadx sees.","Pre-check with Files.exists(Path) before constructing JadxArgs to fail with your own message."],"exampleFix":"// before\nargs.setInputFiles(List.of(new File(inputPath)));\n\n// after\nFile f = new File(inputPath);\nif (!f.isFile()) {\n    throw new IllegalArgumentException(\"Input APK not found at: \" + f.getAbsolutePath());\n}\nargs.setInputFiles(List.of(f));","handlingStrategy":"validation","validationCode":"for (File f : args.getInputFiles()) {\n    if (!f.isFile()) {\n        throw new IllegalArgumentException(\"Input file not found: \" + f.getAbsolutePath());\n    }\n}","typeGuard":null,"tryCatchPattern":"try {\n    decompiler.load();\n} catch (JadxArgsValidateException e) {\n    if (e.getMessage().startsWith(\"File not found\")) {\n        LOG.error(\"Missing input, check path/CWD: {}\", e.getMessage());\n    } else throw e;\n}","preventionTips":["Use absolute paths or resolve relative paths against a known base directory.","Pre-check Files.exists/Files.isRegularFile before constructing JadxArgs.","In containers, confirm the file is mounted to the path jadx sees."],"tags":["validation","io","args","configuration"],"backgroundTag":null,"analyzedSha":"e738a26571d02919f01df40de93bc9a44dee4e18","analyzedAt":"2026-08-14T00:10:24.238Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}