{"record":{"id":"4258e16b9bc3e0b8","repo":"Tencent/matrix","slug":"apk-unzip-path-inputpath-is-not-exists","errorCode":null,"errorMessage":"---APK-UNZIP-PATH '<inputPath>'is not exists!","messagePattern":"---APK-UNZIP-PATH '<inputPath>'is not exists!","errorType":"exception","errorClass":"TaskInitException","httpStatus":null,"severity":"error","filePath":"matrix/matrix-android/matrix-apk-canary/src/main/java/com/tencent/matrix/apk/model/task/DuplicateFileTask.java","lineNumber":71,"sourceCode":"    private List<Pair<String, Long>> fileSizeList;\n    private Map<String, Pair<Long, Long>> entrySizeMap;\n    private Map<String, String> entryNameMap;\n\n    public DuplicateFileTask(JobConfig config, Map<String, String> params) {\n        super(config, params);\n        type = TaskFactory.TASK_TYPE_DUPLICATE_FILE;\n    }\n\n    @Override\n    public void init() throws TaskInitException {\n        super.init();\n        String inputPath = config.getUnzipPath();\n        if (Util.isNullOrNil(inputPath)) {\n            throw new TaskInitException(TAG + \"---APK-UNZIP-PATH can not be null!\");\n        }\n        inputFile = new File(inputPath);\n        if (!inputFile.exists()) {\n            throw new TaskInitException(TAG + \"---APK-UNZIP-PATH '\" + inputPath + \"'is not exists!\");\n        } else if (!inputFile.isDirectory()) {\n            throw new TaskInitException(TAG + \"---APK-UNZIP-PATH '\" + inputPath + \"' is not directory!\");\n        }\n        md5Map = new HashMap<>();\n        fileSizeList = new ArrayList<>();\n        entrySizeMap = config.getEntrySizeMap();\n        entryNameMap = config.getEntryNameMap();\n    }\n\n    private void computeMD5(File file) throws NoSuchAlgorithmException, IOException {\n        if (file != null) {\n            if (file.isDirectory()) {\n                File[] files = file.listFiles();\n                for (File resFile : files) {\n                    computeMD5(resFile);\n                }\n            } else {\n                MessageDigest msgDigest = MessageDigest.getInstance(\"MD5\");","sourceCodeStart":53,"sourceCodeEnd":89,"githubUrl":"https://github.com/Tencent/matrix/blob/3b8293bd65d47eeea7caf1f32a3a5d4d5eab60e7/matrix/matrix-android/matrix-apk-canary/src/main/java/com/tencent/matrix/apk/model/task/DuplicateFileTask.java#L53-L89","documentation":"DuplicateFileTask.init() throws TaskInitException when the configured unzip path does not exist on disk. After checking non-null, it verifies inputFile.exists(); a missing directory means the APK was never unzipped or the path is wrong.","triggerScenarios":"config.getUnzipPath() points to a non-existent filesystem path when DuplicateFileTask.init() runs.","commonSituations":"Typo in the --unzip path; unzip output directory deleted by a clean build; relative path resolved from a different working directory; unzip step skipped or failed earlier.","solutions":["Verify the directory exists: run `ls <unzipPath>` and correct the path if needed.","Run UnzipTask (or unzip the APK manually) so the directory exists before check tasks.","Use an absolute path for --unzip to avoid working-directory ambiguity."],"exampleFix":"// before\nconfig.setUnzipPath(\"build/unzipped-apk\"); // relative, doesn't exist\n// after\nFile dir = new File(\"/abs/path/build/unzipped-apk\");\nif (!dir.exists()) {\n    new UnzipTask().unzip(apkFile, dir); // create it first\n}\nconfig.setUnzipPath(dir.getAbsolutePath());","handlingStrategy":"validation","validationCode":"File dir = new File(config.getUnzipPath());\nif (!dir.exists()) {\n    throw new IllegalStateException(\"unzip path does not exist: \" + dir.getAbsolutePath());\n}","typeGuard":null,"tryCatchPattern":"try {\n    task.init();\n} catch (TaskInitException e) {\n    if (e.getMessage().contains(\"is not exists\")) {\n        unzipApk(apkFile, new File(config.getUnzipPath()));\n        task.init();\n    }\n}","preventionTips":["Use absolute paths for --unzip to avoid CWD ambiguity.","Guarantee the unzip step completes before check tasks (fail fast on its errors).","Verify directory existence with `test -d` in build scripts prior to running the checker."],"tags":["android","apk-checker","filesystem","init"],"backgroundTag":"file-not-found","analyzedSha":"3b8293bd65d47eeea7caf1f32a3a5d4d5eab60e7","analyzedAt":"2026-09-08T08:01:39.722Z","contentChangedAt":"2026-09-08T08:01:39.722Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}