{"record":{"id":"a541a77cd45ddec3","repo":"shwenzhang/AndResGuard","slug":"the-old-mapping-file-do-not-exit-raw-path-s","errorCode":null,"errorMessage":"the old mapping file do not exit, raw path= %s","messagePattern":"the old mapping file do not exit, raw path= (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"AndResGuard-core/src/main/java/com/tencent/mm/resourceproguard/Configuration.java","lineNumber":168,"sourceCode":"      File signatureFile, String keypass, String storealias, String storepass) throws IOException {\n    mUseSignAPK = true;\n    mSignatureFile = signatureFile;\n    if (!mSignatureFile.exists()) {\n      throw new IOException(String.format(\"the signature file do not exit, raw path= %s\\n\",\n          mSignatureFile.getAbsolutePath()\n      ));\n    }\n    mKeyPass = keypass;\n    mStoreAlias = storealias;\n    mStorePass = storepass;\n  }\n\n  private void setKeepMappingData(File mappingFile) throws IOException {\n    if (mUseKeepMapping) {\n      mOldMappingFile = mappingFile;\n\n      if (!mOldMappingFile.exists()) {\n        throw new IOException(String.format(\"the old mapping file do not exit, raw path= %s\",\n            mOldMappingFile.getAbsolutePath()\n        ));\n      }\n      processOldMappingFile();\n    }\n  }\n\n  private void readXmlConfig(File xmlConfigFile) throws IOException, ParserConfigurationException, SAXException {\n    if (!xmlConfigFile.exists()) {\n      return;\n    }\n\n    System.out.printf(\"reading config file, %s\\n\", xmlConfigFile.getAbsolutePath());\n    BufferedInputStream input = null;\n    try {\n      DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();\n      input = new BufferedInputStream(new FileInputStream(xmlConfigFile));\n      InputSource source = new InputSource(input);","sourceCodeStart":150,"sourceCodeEnd":186,"githubUrl":"https://github.com/shwenzhang/AndResGuard/blob/e4df245d82f27d9a2d0dd108260a3510cbaba849/AndResGuard-core/src/main/java/com/tencent/mm/resourceproguard/Configuration.java#L150-L186","documentation":"Configuration.setKeepMappingData throws IOException('the old mapping file do not exit, raw path= %s') when keep-mapping is enabled (mUseKeepMapping=true) but the old proguard/R8 mapping File does not exist. The mapping is needed to reuse previous resource-name mappings so obfuscated names stay stable across releases.","triggerScenarios":"Enabling resguard keep-mapping via config (setKeepMappingData called from the Configuration constructor) with a mapping.txt path that does not exist on disk.","commonSituations":"First build with keep-mapping enabled but no previous mapping.txt produced yet; mapping.txt cleaned by gradle clean or archived away; wrong variant's mapping path configured.","solutions":["Check mappingFile.exists() before enabling keep-mapping, and skip/disable keep-mapping when no prior mapping exists (normal for the first release).","Point the config at the correct previous build's mapping.txt (pin/copy it to a stable location like version control or an artifacts store).","Use an absolute, stable path for the mapping file rather than a clean-prone build/ subpath."],"exampleFix":"// before\nconfig.setUseKeepMapping(true);\nconfig.setKeepMappingData(new File(\"build/outputs/mapping/release/mapping.txt\"));\n// after\nFile mapping = new File(project.getRootDir(), \"resguard-mapping/mapping.txt\");\nif (mapping.isFile()) {\n  config.setUseKeepMapping(true);\n  config.setKeepMappingData(mapping);\n} // first build: keep-mapping off, mapping generated fresh","handlingStrategy":"validation","validationCode":"File m = new File(mappingPath); if (!m.isFile()) { /* disable keep-mapping or fail with clear message */ }","typeGuard":null,"tryCatchPattern":"try { config.setKeepMappingData(mappingFile); } catch (IOException e) { logger.warn(\"keep-mapping disabled: no prior mapping\"); config.setUseKeepMapping(false); }","preventionTips":["Archive mapping.txt to a stable location after each release build","Skip keep-mapping on the first build when no mapping exists yet","Keep mapping outside clean-prone build/ directories"],"tags":["configuration","mapping","proguard","file-not-found"],"backgroundTag":"file-not-found","analyzedSha":"e4df245d82f27d9a2d0dd108260a3510cbaba849","analyzedAt":"2026-09-12T17:49:07.798Z","contentChangedAt":"2026-09-12T17:49:07.798Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}