{"record":{"id":"4dd587238e05a3a7","repo":"Tencent/matrix","slug":"need-signing-apk-but-pathofapksigner-is-not-exist","errorCode":null,"errorMessage":"Need signing apk but $pathOfApkSigner is not exist!","messagePattern":"Need signing apk but \\$pathOfApkSigner 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":494,"sourceCode":"        } 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) {\n                throw GradleException(\"Need signing apk but signingConfig is not specified!\")\n            }\n        }\n    }\n\n    private fun calculateResources(\n            setOfUnusedResources: Set<String>,\n            mapOfDuplicatedResources: Map<String, MutableSet<String>>,\n            mapOfResources: MutableMap<String, Int>,\n            resultOfResourcesGonnaRemoved: MutableMap<String, Int>,\n            resultOfDuplicatesReplacements: MutableMap<String, String>,\n            resultOfObfuscatedNames: MutableMap<String, String>\n    ) {\n\n        // Prepare unused resources\n        val regexpRules = HashSet<String>()\n        for (res in rulesOfIgnore) {","sourceCodeStart":476,"sourceCodeEnd":512,"githubUrl":"https://github.com/Tencent/matrix/blob/3b8293bd65d47eeea7caf1f32a3a5d4d5eab60e7/matrix/matrix-android/matrix-gradle-plugin/src/main/kotlin/com/tencent/matrix/plugin/task/RemoveUnusedResourcesTaskV2.kt#L476-L512","documentation":"Thrown by RemoveUnusedResourcesTaskV2.parametersInvalidation when the configured apksigner path is non-empty but the file does not exist. The build fails fast before resource removal, because re-signing later would be impossible.","triggerScenarios":"useApkSign=true with apksignerPath pointing to a missing binary — e.g. stale build-tools version path, typo, or SDK not installed on the machine running the build.","commonSituations":"SDK upgrades that remove older build-tools directories; different paths on developer machines vs CI; Windows vs Unix path separators copied between configs.","solutions":["Point apksignerPath at an existing apksigner under $ANDROID_HOME/build-tools/<installed-version>/.","Install the required build-tools version via sdkmanager.","Compute the path from project.buildToolsVersion instead of hardcoding it.","Set useApkSign = false if re-signing is handled elsewhere."],"exampleFix":"// before\napksignerPath = \"/Users/me/Library/Android/sdk/build-tools/29.0.2/apksigner\" // uninstalled\n// after\napksignerPath = \"${android.sdkDirectory}/build-tools/${project.buildToolsVersion}/apksigner\"","handlingStrategy":"validation","validationCode":"def apksigner = file(\"${android.sdkDirectory}/build-tools/${project.buildToolsVersion}/apksigner\")\nif (matrix.removeResourceConfig.useApkSign && !apksigner.exists()) {\n  throw new GradleException(\"apksigner missing at ${apksigner}\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Match apksigner's build-tools version to project.buildToolsVersion.","Run sdkmanager \"build-tools;<version>\" in CI setup scripts.","Check path existence after SDK upgrades as part of build environment smoke tests."],"tags":["gradle","android","file-not-found","signing"],"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"}