Tencent/matrix · error · TaskInitException

TAG + "---APK-UNZIP-PATH '" + inputPath + "' is not exist!"

Error message

TAG + "---APK-UNZIP-PATH '" + inputPath + "' is not exist!"

What it means

UnusedAssetsTask.init() throws TaskInitException when the configured APK-UNZIP-PATH fails the existence check — the File at inputPath does not exist on disk. The path value was provided but nothing is there.

Solutions

  1. Run/repair the unzip step and confirm the output directory exists before this task.
  2. Verify the exact path with ls (watch for typos and relative-path resolution).
  3. Keep the unzip output inside the same job workspace so cleanup doesn't remove it mid-run.
  4. Fail fast in your build script if the unzip directory is missing before invoking matrix.

Example fix

// before
matrix.checkUnusedAssets(); // unzip dir deleted earlier
// after
File unzipDir = new File(buildDir, "unzipped-apk");
if (!unzipDir.isDirectory()) {
    throw new GradleException("Run unzipApkTask first; missing " + unzipDir);
}
config.setApkUnzipPath(unzipDir.getAbsolutePath());
Defensive patterns

Strategy: validation

Validate before calling

File unzipDir = new File(unzipPath);
if (!unzipDir.exists()) {
    throw new IllegalStateException("Unzipped APK directory does not exist: " + unzipPath + " — run the unzip task first");
}

Try / catch

try {
    job.run();
} catch (TaskInitException e) {
    if (e.getMessage().contains("is not exist")) {
        log.error("Unzip dir '{}' missing; check unzip task output and CI cleanup", unzipPath);
    } else throw e;
}

Prevention

When it happens

Trigger: Unzip step failed or was skipped, unzip output directory was cleaned between steps, or path contains a typo; running with a stale directory from a previous build deleted by CI cleanup.

Common situations: Parallel CI jobs sharing a workspace where one deletes the unzip dir; unzip task disabled by config but downstream task still enabled; absolute vs relative path mismatch.

Related errors


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

Appendix: source

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

        super(config, params);
        type = TaskFactory.TASK_TYPE_UNUSED_ASSETS;
        dexFileNameList = new ArrayList<>();
        ignoreSet = new HashSet<>();
        assetsPathSet = new HashSet<>();
        assetRefSet = new HashSet<>();
    }

    @Override
    public void init() throws TaskInitException {
        super.init();

        String inputPath = config.getUnzipPath();
        if (Util.isNullOrNil(inputPath)) {
            throw new TaskInitException(TAG + "---APK-UNZIP-PATH can not be null!");
        }
        inputFile = new File(inputPath);
        if (!inputFile.exists()) {
            throw new TaskInitException(TAG + "---APK-UNZIP-PATH '" + inputPath + "' is not exist!");
        } else if (!inputFile.isDirectory()) {
            throw new TaskInitException(TAG + "---APK-UNZIP-PATH '" + inputPath + "' is not directory!");
        }
        if (params.containsKey(JobConstants.PARAM_IGNORE_ASSETS_LIST) && !Util.isNullOrNil(params.get(JobConstants.PARAM_IGNORE_ASSETS_LIST))) {
            String[] ignoreAssets = params.get(JobConstants.PARAM_IGNORE_ASSETS_LIST).split(",");
            Log.i(TAG, "ignore assets %d", ignoreAssets.length);
            for (String ignore : ignoreAssets) {
                ignoreSet.add(Util.globToRegexp(ignore));
            }
        }

        File[] files = inputFile.listFiles();
        if (files != null) {
            for (File file : files) {
                if (file.isFile() && file.getName().endsWith(ApkConstants.DEX_FILE_SUFFIX)) {
                    dexFileNameList.add(file.getName());
                }
            }

View on GitHub (pinned to 3b8293bd65)