{"record":{"id":"6cdb3846f278fc38","repo":"Tencent/matrix","slug":"the-path-of-tool-nm-is-not-given","errorCode":null,"errorMessage":"---The path of tool 'nm' is not given!","messagePattern":"---The path of tool 'nm' is not given!","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":67,"sourceCode":"public class MultiSTLCheckTask extends ApkTask {\n\n    private static final String TAG = \"Matrix.MultiSTLCheckTask\";\n\n    private File libDir;\n    private String toolnmPath;\n\n    public MultiSTLCheckTask(JobConfig jobConfig, Map<String, String> params) {\n        super(jobConfig, params);\n        type = TASK_TYPE_CHECK_MULTISTL;\n    }\n\n    @Override\n    public void init() throws TaskInitException {\n        super.init();\n        final String inputPath = config.getUnzipPath();\n        toolnmPath = params.get(JobConstants.PARAM_TOOL_NM);\n        if (Util.isNullOrNil(toolnmPath)) {\n            throw new TaskInitException(TAG + \"---The path of tool 'nm' is not given!\");\n        } else {\n            Pattern envPattern = Pattern.compile(\"(\\\\$[a-zA-Z_-]+)\");\n            Matcher matcher =  envPattern.matcher(toolnmPath);\n            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)) {","sourceCodeStart":49,"sourceCodeEnd":85,"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#L49-L85","documentation":"MultiSTLCheckTask uses the external 'nm' tool to inspect .so symbol tables. Its init() reads params.get(JobConstants.PARAM_TOOL_NM); if the path to nm is missing or empty, it throws TaskInitException with this message.","triggerScenarios":"Launching MultiSTLCheckTask without passing JobConstants.PARAM_TOOL_NM in the task params map, or passing an empty/null value for the nm tool path.","commonSituations":"Running the checker on a machine without NDK toolchain configuration; forgetting the tool-nm CLI/Gradle option; params map built without the tool entries expected by apk-canary.","solutions":["Pass the nm tool path in params, e.g. params.put(JobConstants.PARAM_TOOL_NM, \"/path/to/ndk/toolchains/.../nm\").","Point it at the NDK-provided nm binary matching your platform (llvm-nm/nm in the NDK toolchain directory).","If using env-var interpolation in the path (e.g. $ANDROID_NDK/...), ensure that env var is set in the environment."],"exampleFix":"// before\nMap<String, String> params = new HashMap<>(); // no PARAM_TOOL_NM\n// after\nparams.put(JobConstants.PARAM_TOOL_NM,\n    \"/opt/android-ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-nm\");","handlingStrategy":"validation","validationCode":"String nm = params.get(JobConstants.PARAM_TOOL_NM);\nif (nm == null || nm.isEmpty()) {\n    throw new IllegalStateException(\"PARAM_TOOL_NM is required for MultiSTLCheckTask\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    task.init();\n} catch (TaskInitException e) {\n    if (e.getMessage().contains(\"tool 'nm'\")) {\n        // add PARAM_TOOL_NM to params pointing at NDK nm/llvm-nm\n    }\n}","preventionTips":["Always populate JobConstants.PARAM_TOOL_NM when enabling STL checks.","Point to the NDK's llvm-nm binary for current NDK versions.","Set needed env vars before the checker JVM starts so $VAR interpolation works."],"tags":["external-tool","config","ndk"],"backgroundTag":"missing-required-argument","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"}