{"record":{"id":"e54ab10e157d9ec3","repo":"Tencent/matrix","slug":"apk-unzip-path-can-not-be-null-e54ab1","errorCode":null,"errorMessage":"---APK-UNZIP-PATH can not be null!","messagePattern":"---APK-UNZIP-PATH can not be null!","errorType":"validation","errorClass":"TaskInitException","httpStatus":null,"severity":"error","filePath":"matrix/matrix-android/matrix-apk-canary/src/main/java/com/tencent/matrix/apk/model/task/MultiSTLCheckTask.java","lineNumber":89,"sourceCode":"            while (matcher.find()) {\n                if (!Util.isNullOrNil(matcher.group())) {\n                    String env = System.getenv(matcher.group().substring(1));\n                    Log.d(TAG, \"%s -> %s\", matcher.group().substring(1), env);\n                    if (!Util.isNullOrNil(env)) {\n                        toolnmPath = toolnmPath.replace(matcher.group(), env);\n                    }\n                }\n            }\n            Log.i(TAG, \"toolnm pah is %s\", toolnmPath);\n        }\n        if (!FileUtil.isLegalFile(toolnmPath)) {\n            throw new TaskInitException(TAG + \"---Can not find the tool 'nm'!\");\n        }\n        if (!Util.isNullOrNil(inputPath)) {\n            Log.i(TAG, \"inputPath:%s\", inputPath);\n            libDir = new File(inputPath, \"lib\");\n        } else {\n            throw new TaskInitException(TAG + \"---APK-UNZIP-PATH can not be null!\");\n        }\n\n    }\n\n    private boolean isStlLinked(File libFile) throws IOException, InterruptedException {\n        ProcessBuilder processBuilder = new ProcessBuilder(toolnmPath, \"-D\", \"-C\", libFile.getAbsolutePath());\n        Process process = processBuilder.start();\n        BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()));\n        String line = reader.readLine();\n        while (line != null) {\n            String[] columns = line.split(\" \");\n            Log.d(TAG, \"%s\", line);\n            if (columns.length >= 3 && columns[1].equals(\"T\") && columns[2].startsWith(\"std::\")) {\n                return true;\n            }\n            line = reader.readLine();\n        }\n        reader.close();","sourceCodeStart":71,"sourceCodeEnd":107,"githubUrl":"https://github.com/Tencent/matrix/blob/3b8293bd65d47eeea7caf1f32a3a5d4d5eab60e7/matrix/matrix-android/matrix-apk-canary/src/main/java/com/tencent/matrix/apk/model/task/MultiSTLCheckTask.java#L71-L107","documentation":"In MultiSTLCheckTask.init(), after validating the nm tool, the unzip path is checked: if config.getUnzipPath() is null/empty the task cannot locate the lib/ directory of native libraries and throws TaskInitException with this message.","triggerScenarios":"Running MultiSTLCheckTask with a valid nm tool path but an unset/empty config.getUnzipPath(), so new File(inputPath, \"lib\") cannot be created.","commonSituations":"Configuring the nm tool but forgetting the unzip path; unzip step skipped; config object constructed per-task with only some fields populated.","solutions":["Set config.setUnzipPath(...) to the unzipped APK directory before running the task.","Ensure the unzip task ran and the directory contains a lib/ folder.","Centralize job config construction so all tasks receive the same populated config."],"exampleFix":"// before\nconfig.setToolNm(nmPath); // unzip path forgotten\n// after\nconfig.setToolNm(nmPath);\nconfig.setUnzipPath(\"/tmp/build/apk-unzipped\");","handlingStrategy":"validation","validationCode":"String p = config.getUnzipPath();\nif (p == null || p.isEmpty() || !new File(p, \"lib\").isDirectory()) {\n    throw new IllegalStateException(\"MultiSTLCheckTask needs unzip path containing lib/\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    task.init();\n} catch (TaskInitException e) {\n    if (e.getMessage().contains(\"APK-UNZIP-PATH can not be null\")) {\n        // set unzip path and rerun\n    }\n}","preventionTips":["Configure unzip path alongside the nm tool path; both are required.","Run the unzip task before STL checks in the pipeline.","Use a single shared, validated JobConfig for all tasks."],"tags":["config","init","native-libraries"],"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"}