{"record":{"id":"41d41cb1e1144fbc","repo":"skylot/jadx","slug":"xml-load-error-file","errorCode":null,"errorMessage":"Xml load error, file: {}","messagePattern":"Xml load error, file: (.+?)","errorType":"exception","errorClass":"JadxRuntimeException","httpStatus":null,"severity":"critical","filePath":"jadx-core/src/main/java/jadx/core/xmlgen/ManifestAttributes.java","lineNumber":93,"sourceCode":"\t\tthis.security = security;\n\t\tparseAll();\n\t}\n\n\tprivate void parseAll() {\n\t\tparse(loadXML(ATTR_XML));\n\t\tparse(loadXML(MANIFEST_ATTR_XML));\n\t\tLOG.debug(\"Loaded android attributes count: {}\", attrMap.size());\n\t}\n\n\tprivate Document loadXML(String xml) {\n\t\tDocument doc;\n\t\ttry (InputStream xmlStream = ManifestAttributes.class.getResourceAsStream(xml)) {\n\t\t\tif (xmlStream == null) {\n\t\t\t\tthrow new JadxRuntimeException(xml + \" not found in classpath\");\n\t\t\t}\n\t\t\tdoc = security.parseXml(xmlStream);\n\t\t} catch (Exception e) {\n\t\t\tthrow new JadxRuntimeException(\"Xml load error, file: \" + xml, e);\n\t\t}\n\t\treturn doc;\n\t}\n\n\tprivate void parse(Document doc) {\n\t\tNodeList nodeList = doc.getChildNodes();\n\t\tfor (int count = 0; count < nodeList.getLength(); count++) {\n\t\t\tNode node = nodeList.item(count);\n\t\t\tif (node.getNodeType() == Node.ELEMENT_NODE\n\t\t\t\t\t&& node.hasChildNodes()) {\n\t\t\t\tparseAttrList(node.getChildNodes());\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate void parseAttrList(NodeList nodeList) {\n\t\tfor (int count = 0; count < nodeList.getLength(); count++) {\n\t\t\tNode tempNode = nodeList.item(count);","sourceCodeStart":75,"sourceCodeEnd":111,"githubUrl":"https://github.com/skylot/jadx/blob/e738a26571d02919f01df40de93bc9a44dee4e18/jadx-core/src/main/java/jadx/core/xmlgen/ManifestAttributes.java#L75-L111","documentation":"Thrown by ManifestAttributes.loadXML(String) when the bundled Android attribute XML (attrs.xml or attrs_manifest.xml) was found on the classpath but could not be parsed by security.parseXml(xmlStream). This means the XML is well-formed syntactically enough to open, but the XML parser (behind the IJadxSecurity interface, typically XXE-safe parsing) rejects it due to a parse error. Since these are jadx's own bundled resources, this indicates a corrupted JAR or a tampered/incompatible resource file.","triggerScenarios":"security.parseXml throws a SAXException or ParserConfigurationException because the bundled XML is malformed, truncated, or not valid XML. A corrupted JAR where the XML resource bytes are damaged. A custom security implementation that is stricter than expected and rejects the bundled XML. An XML parsing library version incompatibility.","commonSituations":"A corrupted JAR download (network error, partial file). A build that processed/transformed the XML resources incorrectly (e.g., a resource filter that mangled the XML). A custom IJadxSecurity implementation with a buggy parser. Classpath conflicts with an older XML parser version.","solutions":["Verify JAR integrity: re-download from the official source and check checksums.","Inspect the XML inside the JAR: unzip -p jadx-core.jar android/attrs.xml | head to check for corruption.","If using a custom IJadxSecurity, test it against known-good XML to rule out parser bugs.","Resolve XML parser version conflicts on the classpath (ensure a modern, compatible Xerces/JDK XML implementation)."],"exampleFix":"// before — custom security with overly strict parser that rejects bundled XML\nsecurity = new CustomSecurity(); // throws on valid attrs.xml\n\n// after — use standard jadx security or test compatibility\nsecurity = new StandardJadxSecurity();\nManifestAttributes ma = new ManifestAttributes(security);","handlingStrategy":"try-catch","validationCode":"public static boolean bundledAttrXmlParses(IJadxSecurity security) {\n    try (InputStream is = ManifestAttributes.class.getResourceAsStream(\"/android/attrs.xml\")) {\n        if (is == null) return false;\n        security.parseXml(is);\n        return true;\n    } catch (Exception e) {\n        return false;\n    }\n}","typeGuard":null,"tryCatchPattern":"try {\n    ManifestAttributes ma = new ManifestAttributes(security);\n} catch (JadxRuntimeException e) {\n    if (e.getMessage().contains(\"Xml load error\")) {\n        System.err.println(\"Corrupted bundled XML or incompatible security parser: \" + e.getCause());\n    }\n    throw e;\n}","preventionTips":["Verify JAR integrity by checking checksums after download.","If using a custom IJadxSecurity, test it against valid XML first.","Resolve XML parser version conflicts on the classpath.","Ensure build tools do not transform or mangle resource XML files."],"tags":["classpath","xml-parsing","resources","corruption","jadx"],"backgroundTag":null,"analyzedSha":"e738a26571d02919f01df40de93bc9a44dee4e18","analyzedAt":"2026-08-14T00:10:24.238Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}