{"record":{"id":"5b1228789d2c01dd","repo":"Tencent/matrix","slug":"manifest-file-inputpath-androidmanifest-xml","errorCode":null,"errorMessage":"---Manifest file '<inputPath>/AndroidManifest.xml' is not exist!","messagePattern":"---Manifest file '<inputPath>/AndroidManifest\\.xml' is not exist!","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":64,"sourceCode":"    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);\n            }\n            TaskResult taskResult = TaskResultFactory.factory(getType(), TASK_RESULT_TYPE_JSON, config);\n            if (taskResult == null) {\n                return null;\n            }","sourceCodeStart":46,"sourceCodeEnd":82,"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#L46-L82","documentation":"ManifestAnalyzeTask.init() throws TaskInitException when <unzipPath>/AndroidManifest.xml does not exist. It locates ApkConstants.MANIFEST_FILE_NAME inside the configured unzip directory and fails if the file is missing, meaning the directory is not a valid unzipped APK root.","triggerScenarios":"config.getUnzipPath() points to a directory that exists but contains no AndroidManifest.xml (wrong directory, not unzipped, or manifest extracted under a different name).","commonSituations":"Pointing --unzip at an unrelated directory; manifest missing because unzip skipped binary manifest; using an AAB-extracted layout without a decoded AndroidManifest.xml; resource obfuscation tools relocating the manifest.","solutions":["Unzip the full APK so AndroidManifest.xml is present at the directory root.","Verify with `ls <unzipPath>/AndroidManifest.xml` and correct the path.","Ensure the unzip step extracts all entries (not only res/), or decode the manifest with apktool if it is absent."],"exampleFix":"// before\nconfig.setUnzipPath(\"/build/classes-only/\"); // no AndroidManifest.xml\n// after\nconfig.setUnzipPath(\"/build/unzipped-apk/\"); // contains AndroidManifest.xml","handlingStrategy":"validation","validationCode":"File manifest = new File(config.getUnzipPath(), \"AndroidManifest.xml\");\nif (!manifest.exists()) {\n    throw new IllegalStateException(\"AndroidManifest.xml missing in \" + config.getUnzipPath());\n}","typeGuard":null,"tryCatchPattern":"try {\n    task.init();\n} catch (TaskInitException e) {\n    if (e.getMessage().contains(\"is not exist\")) {\n        // re-unzip fully or decode manifest with apktool, then retry\n        unzipApk(apkFile, new File(config.getUnzipPath()));\n    }\n}","preventionTips":["Unzip the complete APK (all entries), not just res/ or classes.","Verify AndroidManifest.xml sits at the extraction root before running the task.","If using resource obfuscation tools, confirm they do not remove/relocate the manifest."],"tags":["android","apk-checker","manifest","file-not-found"],"backgroundTag":"file-not-found","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"}