{"record":{"id":"ee8ebffa0e89f992","repo":"Tencent/matrix","slug":"apk-unzip-path-inputpath-is-not-exist-ee8ebf","errorCode":null,"errorMessage":"---APK-UNZIP-PATH '<inputPath>' is not exist!","messagePattern":"---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/UnusedResourcesTask.java","lineNumber":116,"sourceCode":"\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        if (!params.containsKey(JobConstants.PARAM_R_TXT) || Util.isNullOrNil(params.get(JobConstants.PARAM_R_TXT))) {\n            throw new TaskInitException(TAG + \"---The File 'R.txt' can not be null!\");\n        }\n        resourceTxt = new File(params.get(JobConstants.PARAM_R_TXT));\n        if (!FileUtil.isLegalFile(resourceTxt)) {\n            throw new TaskInitException(TAG + \"---The Resource declarations file 'R.txt' is not legal!\");\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 (!Util.isNullOrNil(config.getMappingFilePath())) {\n            mappingTxt = new File(config.getMappingFilePath());\n            if (!FileUtil.isLegalFile(mappingTxt)) {\n                throw new TaskInitException(TAG + \"---The Proguard mapping file 'mapping.txt' is not legal!\");\n            }\n        }\n        if (params.containsKey(JobConstants.PARAM_IGNORE_RESOURCES_LIST) && !Util.isNullOrNil(params.get(JobConstants.PARAM_IGNORE_RESOURCES_LIST))) {\n            String[] ignoreRes = params.get(JobConstants.PARAM_IGNORE_RESOURCES_LIST).split(\",\");\n            for (String ignore : ignoreRes) {\n                ignoreSet.add(Util.globToRegexp(ignore));\n            }\n        }\n        if (!Util.isNullOrNil(config.getResMappingFilePath())) {\n            resMappingTxt = new File(config.getResMappingFilePath());\n            if (!FileUtil.isLegalFile(resMappingTxt)) {","sourceCodeStart":98,"sourceCodeEnd":134,"githubUrl":"https://github.com/Tencent/matrix/blob/3b8293bd65d47eeea7caf1f32a3a5d4d5eab60e7/matrix/matrix-android/matrix-apk-canary/src/main/java/com/tencent/matrix/apk/model/task/UnusedResourcesTask.java#L98-L134","documentation":"Thrown from UnusedResourcesTask.init() when the configured unzip path is non-empty but the directory does not exist on disk. The task correlates R.txt references with resources in the extracted APK tree, so a missing directory fails initialization with TaskInitException — usually a stale or wrong path.","triggerScenarios":"config.getUnzipPath() set to a path that was never created, deleted by clean, or extracted after the task config was built.","commonSituations":"Running the check before the unzip task, pointing at the .apk file instead of the extracted directory, or typo'd absolute paths on CI.","solutions":["Run the unzip task / extract the APK before UnusedResourcesTask and pass that output directory as unzip path","Pass the extracted directory, not the .apk file","Verify the path exists on the machine running the check"],"exampleFix":"// before\nconfig.setUnzipPath(\"/ci/workspace/app-release.apk\");\n// after\nconfig.setUnzipPath(\"/ci/workspace/apk-extracted\"); // directory produced by unzip step","handlingStrategy":"validation","validationCode":"File dir = new File(config.getUnzipPath());\nif (!dir.exists()) throw new IllegalStateException(\"unzip dir does not exist: \" + dir);","typeGuard":null,"tryCatchPattern":"try {\n    task.init();\n} catch (TaskInitException e) {\n    log.error(\"unzip path missing: \" + e.getMessage());\n}","preventionTips":["Run unzip/extraction before resource analysis","Verify paths on the executing machine (CI vs local differ)","Extract to a deterministic directory under build/"],"tags":["android","apk-analysis","path"],"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"}