{"record":{"id":"bc1cac95d699206e","repo":"Tencent/matrix","slug":"the-path-of-matrix-apkchecker-not-found","errorCode":null,"errorMessage":"the path of Matrix-ApkChecker not found!","messagePattern":"the path of Matrix-ApkChecker not found!","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":477,"sourceCode":"                            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!\")\n            } else if (!File(pathOfApkSigner).exists()) {\n                throw GradleException(\"Need signing apk but $pathOfApkSigner is not exist!\")\n            } else if (AgpCompat.getSigningConfig(variant) == null) {","sourceCodeStart":459,"sourceCodeEnd":495,"githubUrl":"https://github.com/Tencent/matrix/blob/3b8293bd65d47eeea7caf1f32a3a5d4d5eab60e7/matrix/matrix-android/matrix-gradle-plugin/src/main/kotlin/com/tencent/matrix/plugin/task/RemoveUnusedResourcesTaskV2.kt#L459-L495","documentation":"The same validation method throws this error when `pathOfApkChecker` is null or empty entirely — i.e. the ApkChecker tool path was never configured, though the V2 removeUnusedResources task requires it to analyze the APK.","triggerScenarios":"`parametersInvalidation` runs with `Util.isNullOrNil(pathOfApkChecker)` true — the extension property was never set in the matrix removeUnusedResources config.","commonSituations":"Adding `matrix { removeUnusedResources { ... } }` with defaults and forgetting the required `pathOfApkChecker`; migrating from V1 task (which doesn't need it) to V2; typos in the property name so the value never lands.","solutions":["Set `pathOfApkChecker` in the removeUnusedResources extension to the full path of the Matrix ApkChecker jar.","Build the ApkChecker from the Matrix repo (`:matrix-apk-checker`) or take the released jar and reference it.","Switch to the V1 RemoveUnusedResourcesTask if checker analysis is not needed."],"exampleFix":"// before\nmatrix {\n  removeUnusedResources {\n    // pathOfApkChecker missing\n  }\n}\n\n// after\nmatrix {\n  removeUnusedResources {\n    pathOfApkChecker = project.rootDir.absolutePath + \"/tools/matrix-apk-checker.jar\"\n  }\n}","handlingStrategy":"validation","validationCode":"assert ext.pathOfApkChecker?.trim() : 'pathOfApkChecker is required by removeUnusedResources V2'","typeGuard":"def hasApkChecker = { String p -> p != null && !p.trim().isEmpty() }","tryCatchPattern":"try { ... } catch (GradleException e) { if (e.message.contains('ApkChecker not found')) { logger.error('Set pathOfApkChecker in the matrix extension') } throw e }","preventionTips":["Always configure pathOfApkChecker when using RemoveUnusedResourcesTaskV2.","Extract the tool path into a shared gradle property so all modules get it.","Consider V1 task if checker analysis is unnecessary."],"tags":["gradle","android","apkchecker","missing-config-value"],"backgroundTag":"missing-required-config-field","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"}