{"record":{"id":"b1a518e237a4b8b3","repo":"Tencent/matrix","slug":"apk-unzip-path-can-not-be-null-b1a518","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/MultiLibCheckTask.java","lineNumber":58,"sourceCode":"\n    private static final String TAG = \"Matrix.MultiLibCheckTask\";\n\n    private File libDir;\n\n    public MultiLibCheckTask(JobConfig jobConfig, Map<String, String> params) {\n        super(jobConfig, params);\n        type = TASK_TYPE_CHECK_MULTILIB;\n    }\n\n    @Override\n    public void init() throws TaskInitException {\n        super.init();\n        String inputPath = config.getUnzipPath();\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    @Override\n    public TaskResult call() throws TaskExecuteException {\n        try {\n            TaskResult taskResult = TaskResultFactory.factory(getType(), TASK_RESULT_TYPE_JSON, config);\n            if (taskResult == null) {\n                return null;\n            }\n            long startTime = System.currentTimeMillis();\n            JsonArray jsonArray = new JsonArray();\n            if (libDir.exists() && libDir.isDirectory()) {\n                File[] dirs = libDir.listFiles();\n                for (File dir : dirs) {\n                    if (dir.isDirectory()) {\n                        jsonArray.add(dir.getName());\n                    }","sourceCodeStart":40,"sourceCodeEnd":76,"githubUrl":"https://github.com/Tencent/matrix/blob/3b8293bd65d47eeea7caf1f32a3a5d4d5eab60e7/matrix/matrix-android/matrix-apk-canary/src/main/java/com/tencent/matrix/apk/model/task/MultiLibCheckTask.java#L40-L76","documentation":"MultiLibCheckTask.init() checks for native libraries that are linked against multiple STLs; it needs config.getUnzipPath() to locate the \"lib\" directory. If the unzip path is null/empty it throws TaskInitException with this message.","triggerScenarios":"Running MultiLibCheckTask with an ApkDetector/JobConfig whose unzip path was never set or is an empty string, so new File(inputPath, \"lib\") cannot be constructed.","commonSituations":"Same config mistakes as other apk-canary tasks: forgetting setUnzipPath(), upstream unzip task skipped or failed, params not plumbed through Gradle/CLI configuration.","solutions":["Set config.setUnzipPath(...) to the unzipped APK directory before this task runs.","Ensure the unzip task completed successfully and produced a lib/ subdirectory.","Verify the config object is shared/populated for all tasks, not only some."],"exampleFix":"// before\nJobConfig config = new JobConfig(); // no unzip path\n// after\nJobConfig config = new JobConfig();\nconfig.setUnzipPath(\"/tmp/build/apk-unzipped\");","handlingStrategy":"validation","validationCode":"String p = config.getUnzipPath();\nif (p == null || p.isEmpty() || !new File(p, \"lib\").exists()) {\n    throw new IllegalStateException(\"unzip path with lib/ required for MultiLibCheckTask\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    task.init();\n} catch (TaskInitException e) {\n    if (e.getMessage().contains(\"can not be null\")) {\n        // skip native-lib checks or fix config, then rerun\n    }\n}","preventionTips":["Set unzip path before registering any native-library tasks.","Confirm the unzipped APK contains lib/ when the app ships native code.","Validate job config in one place 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"}