{"record":{"id":"0a310b952aead5b5","repo":"Tencent/tinker","slug":"mapping-file-is-not-exist-path-s-0a310b","errorCode":null,"errorMessage":"mapping file is not exist, path=%s","messagePattern":"mapping file is not exist, path=(.+?)","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"tinker-build/tinker-patch-cli/tool_output/proguard_warning.py","lineNumber":98,"sourceCode":"        with open(output_path, \"w\") as fw:\n            for key in self.class_list:\n                if key in self.classes:\n                    data = self.classes[key]\n                    fw.write(data.raw_line)\n                    for line in data.filed_methods:\n                        fw.write(line)\n\n    def remove_warning_mapping(self, mapping, warning):\n        self.read_mapping_file(mapping)\n        self.remove_warning(warning)\n\n    def do_command(self, args):\n        if (len(args) < 2):\n            print_usage()\n\n        mapping_path = args[0]\n        if not os.path.exists(mapping_path):\n            raise Exception(\"mapping file is not exist, path=%s\", mapping_path)\n\n        warning_patch = args[1]\n        if not os.path.exists(warning_patch):\n            raise Exception(\"proguard warning file is not exist, path=%s\", warning_patch)\n\n        self.remove_warning_mapping(mapping_path, warning_patch)\n\n\n\nif __name__ == '__main__':\n    RemoveProguardWarning().do_command(sys.argv[1:])","sourceCodeStart":80,"sourceCodeEnd":109,"githubUrl":"https://github.com/Tencent/tinker/blob/1b7ea02c239840f563ea64fb5bd286eb98d4011e/tinker-build/tinker-patch-cli/tool_output/proguard_warning.py#L80-L109","documentation":"Raised by RemoveProguardWarning.do_command() in proguard_warning.py (line 98) when args[0] — the proguard mapping.txt — does not exist. The tool then reads the mapping, and for each 'Warning:' line in args[1] removes the offending members. As with the sibling scripts, the message's '%s' placeholder is never interpolated because the path is passed as an extra Exception argument (Python 2 idiom misuse), so the user sees the literal format string without the offending path.","triggerScenarios":"Invoking 'python proguard_warning.py <mapping> <warnings>' where the mapping path is mistyped, relative to the wrong CWD, or the mapping file was never produced (build without minifyEnabled, or build/ cleaned) or lives in a different module's outputs directory.","commonSituations":"CI automation computing the mapping path from variables that are empty on some branches; developers running the tool from the repo root while the mapping sits under app/build/outputs/mapping/release/; renaming artifacts between proguard versions.","solutions":["Locate the real mapping: look under <module>/build/outputs/mapping/release/mapping.txt after a minified build.","Pass an absolute path for args[0].","Assert existence in the wrapper before calling: test -f \"$MAP\" || { echo \"missing $MAP\"; exit 1; }.","Fix the formatting bug if you own the script: raise Exception(\"mapping file is not exist, path=%s\" % mapping_path)."],"exampleFix":"# before\npython proguard_warning.py mapping.txt warnings.txt  # mapping.txt not in CWD\n\n# after\npython proguard_warning.py \"$APP_ROOT/app/build/outputs/mapping/release/mapping.txt\" warnings.txt","handlingStrategy":"validation","validationCode":"import os, sys\nmapping = sys.argv[1]\nif not os.path.isfile(mapping):\n    sys.exit('mapping not found: %s — expected <module>/build/outputs/mapping/release/mapping.txt' % mapping)","typeGuard":null,"tryCatchPattern":"try:\n    RemoveProguardWarning().do_command(sys.argv[1:])\nexcept Exception as e:\n    if 'mapping file is not exist' in str(e):\n        sys.exit('supply a valid mapping.txt path and rerun')\n    raise","preventionTips":["Run a minified build first so mapping.txt exists, then reference it by absolute path.","Validate both CLI arguments with os.path.isfile in a wrapper.","Remember the tool does not interpolate '%s' — log the paths yourself on failure."],"tags":["python","proguard","mapping","cli","file-not-found"],"backgroundTag":null,"analyzedSha":"1b7ea02c239840f563ea64fb5bd286eb98d4011e","analyzedAt":"2026-08-14T15:16:52.110Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}