{"record":{"id":"e48b79ec110fc10b","repo":"Tencent/matrix","slug":"tag-apk-unzip-path-inputpath-is-no-e48b79","errorCode":null,"errorMessage":"TAG + \"---APK-UNZIP-PATH '\" + inputPath + \"' is not exist!\"","messagePattern":"TAG \\+ \"---APK-UNZIP-PATH '\" \\+ inputPath \\+ \"' is not exist!\"","errorType":"exception","errorClass":"TaskInitException","httpStatus":null,"severity":"error","filePath":"matrix/matrix-android/matrix-apk-canary/src/main/java/com/tencent/matrix/apk/model/task/UnusedAssetsTask.java","lineNumber":82,"sourceCode":"        super(config, params);\n        type = TaskFactory.TASK_TYPE_UNUSED_ASSETS;\n        dexFileNameList = new ArrayList<>();\n        ignoreSet = new HashSet<>();\n        assetsPathSet = new HashSet<>();\n        assetRefSet = new HashSet<>();\n    }\n\n    @Override\n    public void init() throws TaskInitException {\n        super.init();\n\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 exist!\");\n        } else if (!inputFile.isDirectory()) {\n            throw new TaskInitException(TAG + \"---APK-UNZIP-PATH '\" + inputPath + \"' is not directory!\");\n        }\n        if (params.containsKey(JobConstants.PARAM_IGNORE_ASSETS_LIST) && !Util.isNullOrNil(params.get(JobConstants.PARAM_IGNORE_ASSETS_LIST))) {\n            String[] ignoreAssets = params.get(JobConstants.PARAM_IGNORE_ASSETS_LIST).split(\",\");\n            Log.i(TAG, \"ignore assets %d\", ignoreAssets.length);\n            for (String ignore : ignoreAssets) {\n                ignoreSet.add(Util.globToRegexp(ignore));\n            }\n        }\n\n        File[] files = inputFile.listFiles();\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                }\n            }","sourceCodeStart":64,"sourceCodeEnd":100,"githubUrl":"https://github.com/Tencent/matrix/blob/3b8293bd65d47eeea7caf1f32a3a5d4d5eab60e7/matrix/matrix-android/matrix-apk-canary/src/main/java/com/tencent/matrix/apk/model/task/UnusedAssetsTask.java#L64-L100","documentation":"UnusedAssetsTask.init() throws TaskInitException when the configured APK-UNZIP-PATH fails the existence check — the File at inputPath does not exist on disk. The path value was provided but nothing is there.","triggerScenarios":"Unzip step failed or was skipped, unzip output directory was cleaned between steps, or path contains a typo; running with a stale directory from a previous build deleted by CI cleanup.","commonSituations":"Parallel CI jobs sharing a workspace where one deletes the unzip dir; unzip task disabled by config but downstream task still enabled; absolute vs relative path mismatch.","solutions":["Run/repair the unzip step and confirm the output directory exists before this task.","Verify the exact path with ls (watch for typos and relative-path resolution).","Keep the unzip output inside the same job workspace so cleanup doesn't remove it mid-run.","Fail fast in your build script if the unzip directory is missing before invoking matrix."],"exampleFix":"// before\nmatrix.checkUnusedAssets(); // unzip dir deleted earlier\n// after\nFile unzipDir = new File(buildDir, \"unzipped-apk\");\nif (!unzipDir.isDirectory()) {\n    throw new GradleException(\"Run unzipApkTask first; missing \" + unzipDir);\n}\nconfig.setApkUnzipPath(unzipDir.getAbsolutePath());","handlingStrategy":"validation","validationCode":"File unzipDir = new File(unzipPath);\nif (!unzipDir.exists()) {\n    throw new IllegalStateException(\"Unzipped APK directory does not exist: \" + unzipPath + \" — run the unzip task first\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    job.run();\n} catch (TaskInitException e) {\n    if (e.getMessage().contains(\"is not exist\")) {\n        log.error(\"Unzip dir '{}' missing; check unzip task output and CI cleanup\", unzipPath);\n    } else throw e;\n}","preventionTips":["Sequence tasks so unzip always precedes UnusedAssetsTask.","Avoid CI cleanup steps that delete workspace dirs mid-job.","Verify paths with ls/exists() after each pipeline stage.","Watch for typo'd or relative paths resolving elsewhere."],"tags":["android","apk-canary","file-not-found","pipeline"],"backgroundTag":"directory-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"}