Tencent/matrix · error · GradleScriptException
Cannot find
Error message
Cannot find ${debugStubPropFile} What it means
WeChatDebugStub2.gradle loads a properties file (debugStubPropFile) that defines the debug APK path and module list; if the file does not exist on disk it throws GradleScriptException with the missing path in the message.
Solutions
- Create the debug stub properties file at the expected path with apk=... and (optionally) modules=... entries
- Check the configured debugStubPropFile path in the script matches where you put the file
- Commit or generate the properties file in CI so the environment is reproducible
Example fix
// before # (file missing) // after # debug-stub.properties apk=/path/to/app-debug.apk modules=app
Defensive patterns
Strategy: validation
Validate before calling
// before running the task
def propFile = file('debug-stub.properties')
if (!propFile.exists()) throw new StopExecutionException('Create debug-stub.properties with apk=...') Prevention
- Commit a template properties file with placeholders
- Generate the file in CI setup steps
- Document required file and keys in the module README
When it happens
Trigger: Running the debug-stub build task without creating the expected .properties file, or with the file at a different location than the configured debugStubPropFile path.
Common situations: Fresh checkout/CI environment missing a local (non-committed) properties file; renaming or moving the properties file; forgetting the setup step documented in the script.
Related errors
- 'apk' property not defined in
- This plugin must be applied after "com.android.library"…
- Debugging APK not exist
- [-] Either or should be applied when use this script.
- Debugging APK must be debuggable.
AI-assisted analysis of Tencent/matrix@3b8293bd65 (2026-09-08).
Data as JSON: /api/errors/5e218566c47487f9.
Report an issue: GitHub.
Appendix: source
Thrown at matrix/matrix-android/gradle/WeChatDebugStub2.gradle:31
import java.nio.file.Files
import java.nio.file.StandardCopyOption
import java.util.zip.ZipFile
import net.dongliu.apk.parser.*
File debugApk
File keystoreFile
Set debugModules = []
Set installAbis = []
File manifestFile = file('AndroidManifest.xml')
File propFile = file('debug.properties')
File debugStubPropFile = rootProject.file('debug-stub.properties')
def minSdk
def targetSdk
// Load APK, keystore path from properties file.
if (!debugStubPropFile.exists()) {
throw new GradleScriptException("Cannot find ${debugStubPropFile}")
} else {
def prop = new Properties()
debugStubPropFile.withInputStream { prop.load(it) }
def apkPath = prop.getProperty('apk', null)
if (apkPath) {
debugApk = rootProject.file(apkPath)
if (!debugApk.exists()) {
throw new GradleScriptException("Debugging APK not exist: ${debugApk}")
}
} else throw new GradleScriptException("'apk' property not defined in ${debugStubPropFile}")
def modules = prop.getProperty('modules', '').trim()
if (modules) {
debugModules.addAll modules.split(/\s*,\s*/)
}
def keystorePath = prop.getProperty('keystore', null)View on GitHub (pinned to 3b8293bd65)