{"record":{"id":"2c96bd062ae987cf","repo":"Tencent/matrix","slug":"the-path-of-matrix-apkchecker-pathofapkchecker-is","errorCode":null,"errorMessage":"the path of Matrix-ApkChecker $pathOfApkChecker is not exist!","messagePattern":"the path of Matrix-ApkChecker \\$pathOfApkChecker is not exist!","errorType":"exception","errorClass":"GradleException","httpStatus":null,"severity":"error","filePath":"matrix/matrix-android/matrix-gradle-plugin/src/main/kotlin/com/tencent/matrix/plugin/task/RemoveUnusedResourcesTaskV2.kt","lineNumber":474,"sourceCode":"                            val md5 = obj.get(\"md5\")\n                            resultOfDuplicates[md5.toString()] = HashSet()\n                            val fileList = obj.get(\"files\").asJsonArray\n                            for (m in 0 until fileList.size()) {\n                                resultOfDuplicates[md5.toString()]?.add(fileList.get(m).asString)\n                            }\n                        }\n                    }\n                }\n            }\n        }\n    }\n\n    private fun parametersInvalidation() {\n\n        // Validate path of ApkChecker tool\n        if (!Util.isNullOrNil(pathOfApkChecker)) {\n            if (!File(pathOfApkChecker).exists()) {\n                throw GradleException(\"the path of Matrix-ApkChecker $pathOfApkChecker is not exist!\")\n            }\n        } else {\n            throw GradleException(\"the path of Matrix-ApkChecker not found!\")\n        }\n\n        // Validate path of Zipalign tool\n        if (isZipAlignEnabled) {\n            if (Util.isNullOrNil(pathOfZipAlign)) {\n                throw GradleException(\"Need zip align apk but the path of zipalign is not specified!\")\n            } else if (!File(pathOfZipAlign).exists()) {\n                throw GradleException(\"Need zipalign apk but $pathOfZipAlign is not exist!\")\n            }\n        }\n\n        // Validate path of signing\n        if (isSigningEnabled) {\n            if (Util.isNullOrNil(pathOfApkSigner)) {\n                throw GradleException(\"Need signing apk but the path of apksigner is not specified!\")","sourceCodeStart":456,"sourceCodeEnd":492,"githubUrl":"https://github.com/Tencent/matrix/blob/3b8293bd65d47eeea7caf1f32a3a5d4d5eab60e7/matrix/matrix-android/matrix-gradle-plugin/src/main/kotlin/com/tencent/matrix/plugin/task/RemoveUnusedResourcesTaskV2.kt#L456-L492","documentation":"Before running, the V2 task validates its tool parameters in `parametersInvalidation`. If `pathOfApkChecker` is non-empty but the file is not present on disk, the task throws with the configured path embedded in the message. ApkChecker is mandatory for this task, so a bad path aborts the build.","triggerScenarios":"`pathOfApkChecker` set to a non-empty string that fails `File(...).exists()` when the task's `parametersInvalidation` runs at task execution.","commonSituations":"Path copied from another machine/CI; apkchecker jar deleted during clean; using a directory path instead of the jar file; renamed artifact after a Matrix version upgrade.","solutions":["Set `pathOfApkChecker` to the existing Matrix-ApkChecker jar path (e.g. `.../matrix/apkchecker/apkchecker.jar`) and confirm with `ls`.","Download/copy the Matrix ApkChecker artifact for your Matrix version into the configured location.","Ensure the path points to the jar file itself, not its containing directory.","If you only want unused-resource removal without checker analysis, use RemoveUnusedResourcesTask (V1) which doesn't require ApkChecker."],"exampleFix":"// before\npathOfApkChecker = \"/libs/apkchecker-0.6.5.jar\" // deleted\n\n// after\npathOfApkChecker = \"/opt/matrix/matrix-apk-checker-1.0.0.jar\" // confirmed on disk","handlingStrategy":"validation","validationCode":"def checker = new File(ext.pathOfApkChecker)\nassert checker.exists() && checker.isFile() : \"ApkChecker missing at ${checker}\"","typeGuard":"def apkCheckerExists = { String p -> p != null && new File(p).isFile() }","tryCatchPattern":"try { ... } catch (GradleException e) { if (e.message.contains('ApkChecker') && e.message.contains('is not exist')) { logger.error('Fix pathOfApkChecker: ' + e.message) } throw e }","preventionTips":["Commit/check the ApkChecker jar into a stable tools/ directory referenced relatively.","Verify the path after every Matrix version upgrade.","Point at the jar file, not its directory."],"tags":["gradle","android","apkchecker","file-not-found"],"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"}