Tencent/matrix · error · TaskExecuteException

TAG + "---No resource directory found!"

Error message

TAG + "---No resource directory found!"

What it means

Raised in ResProguardCheckTask.call() when neither the expected resource directory layout is found in the unzipped APK: the task looks for res/ (or the resource dir constant) and neither candidate exists or is a directory. This means the input is not a validly extracted APK or the APK lacks a resource directory, so the resguard check cannot proceed and the task throws a TaskExecuteException.

Solutions

  1. Verify the APK was built with expected resource structure; the task looks for the res/ directory (RESOURCE_DIR_NAME)
  2. Check the input directory is a correctly unzipped APK root
  3. Skip this check if resource-proguard detection is not applicable to the input
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at matrix/matrix-android/matrix-apk-canary/src/main/java/com/tencent/matrix/apk/model/task/ResProguardCheckTask.java:97 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of Tencent/matrix@3b8293bd65 (2026-09-08). Data as JSON: /api/errors/236119505adf97df. Report an issue: GitHub.

Appendix: source

Thrown at matrix/matrix-android/matrix-apk-canary/src/main/java/com/tencent/matrix/apk/model/task/ResProguardCheckTask.java:97

            long startTime = System.currentTimeMillis();
            if (resDir.exists() && resDir.isDirectory()) {
                Log.i(TAG, "find resource directory " + resDir.getAbsolutePath());
                ((TaskJsonResult) taskResult).add("hasResProguard", true);
            } else {
                resDir = new File(inputFile, ApkConstants.RESOURCE_DIR_NAME);
                if (resDir.exists() && resDir.isDirectory()) {
                    File[] dirs = resDir.listFiles();
                    boolean hasProguard = true;
                    for (File dir : dirs) {
                        if (dir.isDirectory() && !fileNamePattern.matcher(dir.getName()).matches()) {
                            hasProguard = false;
                            Log.i(TAG, "directory " + dir.getName() + " has a non-proguard name!");
                            break;
                        }
                    }
                    ((TaskJsonResult) taskResult).add("hasResProguard", hasProguard);
                } else {
                    throw new TaskExecuteException(TAG + "---No resource directory found!");
                }
            }
            taskResult.setStartTime(startTime);
            taskResult.setEndTime(System.currentTimeMillis());
            return taskResult;
        } catch (Exception e) {
            throw new TaskExecuteException(e.getMessage(), e);
        }
    }
}

View on GitHub (pinned to 3b8293bd65)