{"record":{"id":"126f0fd6d443c61a","repo":"Tencent/matrix","slug":"apk-unzip-path-inputpath-is-not-exist-126f0f","errorCode":null,"errorMessage":"---APK-UNZIP-PATH '<inputPath>' is not exist!","messagePattern":"---APK-UNZIP-PATH '<inputPath>' is not exist!","errorType":"validation","errorClass":"TaskInitException","httpStatus":null,"severity":"error","filePath":"matrix/matrix-android/matrix-apk-canary/src/main/java/com/tencent/matrix/apk/model/task/MethodCountTask.java","lineNumber":90,"sourceCode":"        dexFileNameList = new ArrayList<String>();\n        dexFileList = new ArrayList<RandomAccessFile>();\n        classInternalMethod = new HashMap<String, Integer>();\n        classExternalMethod = new HashMap<String, Integer>();\n        pkgInternalRefMethod = new HashMap<String, Integer>();\n        pkgExternalMethod = new HashMap<String, Integer>();\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        Log.i(TAG, \"input path:%s\", inputPath);\n        inputFile = new File(inputPath);\n        if (!inputFile.exists()) {\n            throw new TaskInitException(TAG + \"---APK-UNZIP-PATH '\" + inputPath + \"' is not exist!\");\n        } else if (!inputFile.isDirectory()) {\n            throw new TaskInitException(TAG + \"---APK-UNZIP-PATH '\" + inputPath + \"' is not directory!\");\n        }\n        File[] files = inputFile.listFiles();\n        try {\n            if (files != null) {\n                for (File file : files) {\n                    if (file.isFile() && file.getName().endsWith(ApkConstants.DEX_FILE_SUFFIX)) {\n                        dexFileNameList.add(file.getName());\n                        RandomAccessFile randomAccessFile = new RandomAccessFile(file, \"rw\");\n                        dexFileList.add(randomAccessFile);\n                    }\n                }\n            }\n        } catch (FileNotFoundException e) {\n            throw new TaskInitException(e.getMessage(), e);\n        }\n        if (params.containsKey(JobConstants.PARAM_GROUP)) {","sourceCodeStart":72,"sourceCodeEnd":108,"githubUrl":"https://github.com/Tencent/matrix/blob/3b8293bd65d47eeea7caf1f32a3a5d4d5eab60e7/matrix/matrix-android/matrix-apk-canary/src/main/java/com/tencent/matrix/apk/model/task/MethodCountTask.java#L72-L108","documentation":"In MethodCountTask.init(), after a non-empty unzip path is obtained, a File is created and checked with exists(). If the path does not exist on disk, init throws TaskInitException with this message. It guards against pointing the method-count analysis at a missing directory.","triggerScenarios":"config.getUnzipPath() returns a non-empty path, but new File(inputPath).exists() is false — i.e. the directory was deleted, never created, or the path is misspelled when MethodCountTask.init() runs.","commonSituations":"Typos in the configured path; unzipped output cleaned by a build between tasks; running on a machine/container where the unzip output was never produced; relative path resolved against an unexpected working directory.","solutions":["Verify the configured unzip path exists (File.exists() in a pre-check or ls the directory) before running the task.","Fix the path string to the actual directory of the unzipped APK.","Re-run the unzip step to regenerate the directory if it was removed."],"exampleFix":"// before\nconfig.setUnzipPath(\"/tmp/build/apk_unzipped\"); // directory never created\n// after\nFile dir = new File(\"/tmp/build/apk_unzipped\");\nif (dir.exists() && dir.isDirectory()) {\n    config.setUnzipPath(dir.getAbsolutePath());\n}","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 exist\")) {\n        // re-run unzip step, then retry task\n    }\n}","preventionTips":["Unzip the APK and verify the output directory exists before running apk-canary tasks.","Use absolute paths to avoid working-directory surprises.","Do not clean shared temp directories while a check pipeline is running."],"tags":["config","filesystem","apk-canary"],"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"}