{"record":{"id":"acaa7eba64b230d8","repo":"skylot/jadx","slug":"can-t-parse-type-unexpected","errorCode":null,"errorMessage":"Can't parse type: {}, unexpected: {}","messagePattern":"Can't parse type: (.+?), unexpected: (.+?)","errorType":"exception","errorClass":"JadxRuntimeException","httpStatus":null,"severity":"error","filePath":"jadx-core/src/main/java/jadx/core/dex/nodes/parser/SignatureParser.java","lineNumber":169,"sourceCode":"\t\t\t\t\treturn ArgType.genericType(typeVarName);\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase '[':\n\t\t\t\treturn ArgType.array(consumeType());\n\n\t\t\tcase STOP_CHAR:\n\t\t\t\treturn null;\n\n\t\t\tdefault:\n\t\t\t\t// primitive type (one char)\n\t\t\t\tArgType type = ArgType.parse(ch);\n\t\t\t\tif (type != null) {\n\t\t\t\t\treturn type;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t\tthrow new JadxRuntimeException(\"Can't parse type: \" + debugString() + \", unexpected: \" + ch);\n\t}\n\n\tpublic List<ArgType> consumeTypeList() {\n\t\tList<ArgType> list = null;\n\t\twhile (true) {\n\t\t\tArgType type = consumeType();\n\t\t\tif (type == null) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (list == null) {\n\t\t\t\tlist = new ArrayList<>();\n\t\t\t}\n\t\t\tlist.add(type);\n\t\t}\n\t\tif (list == null) {\n\t\t\treturn Collections.emptyList();\n\t\t}\n\t\treturn list;","sourceCodeStart":151,"sourceCodeEnd":187,"githubUrl":"https://github.com/skylot/jadx/blob/e738a26571d02919f01df40de93bc9a44dee4e18/jadx-core/src/main/java/jadx/core/dex/nodes/parser/SignatureParser.java#L151-L187","documentation":"Thrown by SignatureParser.consumeType() when the current character is not a recognised signature start token — not 'L' (object), 'T' (type variable), '[' (array), STOP_CHAR (end), or a single-char primitive (BCDFIJSZV). This means the signature string contains an unexpected character at a position where a type is required, indicating a corrupt or malformed Signature attribute.","triggerScenarios":"consumeType() is called (directly or via consumeTypeList / consumeMethodArgs / consumeExtendsTypesList), the switch falls through the default branch, ArgType.parse(ch) returns null for the char, and execution reaches the final throw. The char is something like '@', '(', or a letter that is not a valid primitive code.","commonSituations":"Malformed Signature attributes from obfuscators or bytecode manipulators that emit non-standard signatures. Can also occur if jadx's caller passes a raw descriptor where a full signature is expected, or if a DEX merger concatenated signature strings incorrectly.","solutions":["Upgrade jadx — the parser is continuously hardened against unusual signatures.","Wrap per-class decompilation in try-catch for JadxRuntimeException and continue with remaining classes.","Report the issue with the full debug string from the error message (it includes the signature and the failing position).","Remove the malformed Signature attribute from the offending class using ASM before feeding the file to jadx."],"exampleFix":"// before\nString code = javaClass.getCode();\n\n// after\ntry {\n    String code = javaClass.getCode();\n} catch (JadxRuntimeException e) {\n    LOG.warn(\"Signature parse failed for {}: {}\", javaClass.getName(), e.getMessage());\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    String code = javaClass.getCode();\n} catch (JadxRuntimeException e) {\n    LOG.warn(\"Type parse failed in {}: {}\", javaClass.getName(), e.getMessage());\n    // fall back to raw bytecode / smali for this class\n}","preventionTips":["Upgrade jadx regularly for parser improvements.","Decompile per-class with try-catch to isolate failures.","Avoid feeding hand-edited or re-serialized DEX files; use original compiler output when possible.","File bug reports with the exact signature string from the error message."],"tags":["jadx","decompiler","signature-parser","parsing","obfuscation","bytecode"],"backgroundTag":null,"analyzedSha":"e738a26571d02919f01df40de93bc9a44dee4e18","analyzedAt":"2026-08-14T00:10:24.238Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}