{"record":{"id":"f0a8e3738d9d5e0a","repo":"Tencent/matrix","slug":"apk-unzip-path-can-not-be-null-f0a8e3","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/ManifestAnalyzeTask.java","lineNumber":59,"sourceCode":"\npublic class ManifestAnalyzeTask extends ApkTask {\n\n    private static final String TAG = \"Matrix.ManifestAnalyzeTask\";\n\n    private File inputFile;\n    private File arscFile;\n\n    public ManifestAnalyzeTask(JobConfig config, Map<String, String> params) {\n        super(config, params);\n        type = TASK_TYPE_MANIFEST;\n    }\n\n    @Override\n    public void init() throws TaskInitException {\n        super.init();\n        String inputPath = config.getUnzipPath();\n        if (Util.isNullOrNil(inputPath)) {\n            throw new TaskInitException(TAG + \"---APK-UNZIP-PATH can not be null!\");\n        }\n        Log.i(TAG, \"inputPath:%s\", inputPath);\n        inputFile = new File(inputPath, ApkConstants.MANIFEST_FILE_NAME);\n        if (!inputFile.exists()) {\n            throw new TaskInitException(TAG + \"---Manifest file '\" + inputPath + File.separator + ApkConstants.MANIFEST_FILE_NAME + \"' is not exist!\");\n        }\n\n        arscFile = new File(inputPath, ApkConstants.ARSC_FILE_NAME);\n    }\n\n    @Override\n    public TaskResult call() throws TaskExecuteException {\n        try {\n            ManifestParser manifestParser = null;\n            if (!FileUtil.isLegalFile(arscFile)) {\n                manifestParser = new ManifestParser(inputFile);\n            } else {\n                manifestParser = new ManifestParser(inputFile, arscFile);","sourceCodeStart":41,"sourceCodeEnd":77,"githubUrl":"https://github.com/Tencent/matrix/blob/3b8293bd65d47eeea7caf1f32a3a5d4d5eab60e7/matrix/matrix-android/matrix-apk-canary/src/main/java/com/tencent/matrix/apk/model/task/ManifestAnalyzeTask.java#L41-L77","documentation":"ManifestAnalyzeTask throws TaskInitException during init() when config.getUnzipPath() is null or empty. This task parses AndroidManifest.xml from the unzipped APK to extract package name, versions, components, and permissions.","triggerScenarios":"Running ManifestAnalyzeTask with a JobConfig whose PARAM_UNZIP_PATH is null or empty (e.g. missing '--unzip' CLI option).","commonSituations":"Invoking ApkChecker with --task ManifestAnalyze but forgetting --unzip; programmatic config missing setUnzipPath; configuration overwritten by another task.","solutions":["Add '--unzip <dir>' to the ApkChecker command or call config.setUnzipPath(path).","Ensure the unzip step runs and populates the config before ManifestAnalyzeTask init.","Log config.getUnzipPath() before task execution to catch nulls early."],"exampleFix":"// before\nJobConfig config = new JobConfig();\nconfig.addTask(TaskFactory.TASK_TYPE_MANIFEST_ANALYZE); // no unzip path\n// after\nconfig.setUnzipPath(\"/build/unzipped-apk/\");\nconfig.addTask(TaskFactory.TASK_TYPE_MANIFEST_ANALYZE);","handlingStrategy":"validation","validationCode":"String unzipPath = config.getUnzipPath();\nif (unzipPath == null || unzipPath.trim().isEmpty()) {\n    throw new IllegalStateException(\"unzip path must be set before running ManifestAnalyzeTask\");\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        config.setUnzipPath(extractedDir.getAbsolutePath());\n    }\n}","preventionTips":["Always supply --unzip when --task ManifestAnalyze is requested.","Order UnzipTask before ManifestAnalyzeTask in the pipeline.","Fail fast in your wrapper if config.getUnzipPath() is null."],"tags":["android","apk-checker","manifest","config"],"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"}