{"record":{"id":"a981a3bc16a3f7da","repo":"Tencent/tinker","slug":"invalid-debug-item-type","errorCode":null,"errorMessage":"Invalid debug item type: ","messagePattern":"Invalid debug item type: ","errorType":"exception","errorClass":"ExceptionWithContext","httpStatus":null,"severity":"error","filePath":"tinker-build/tinker-patch-lib/src/main/java/org/jf/dexlib2/builder/BuilderMutableMethodImplementation.java","lineNumber":1126,"sourceCode":"                RestartLocal restartLocal = (RestartLocal) debugItem;\n                return new BuilderRestartLocal(restartLocal.getRegister());\n            }\n            case DebugItemType.PROLOGUE_END:\n                return new BuilderPrologueEnd();\n            case DebugItemType.EPILOGUE_BEGIN:\n                return new BuilderEpilogueBegin();\n            case DebugItemType.LINE_NUMBER: {\n                LineNumber lineNumber = (LineNumber) debugItem;\n                return new BuilderLineNumber(lineNumber.getLineNumber());\n            }\n            case DebugItemType.SET_SOURCE_FILE: {\n                SetSourceFile setSourceFile = (SetSourceFile) debugItem;\n                return new BuilderSetSourceFile(\n                        (StringReference) convertReference(setSourceFile.getSourceFileReference())\n                );\n            }\n            default:\n                throw new ExceptionWithContext(\"Invalid debug item type: \" + debugItem.getDebugItemType());\n        }\n    }\n}","sourceCodeStart":1108,"sourceCodeEnd":1129,"githubUrl":"https://github.com/Tencent/tinker/blob/1b7ea02c239840f563ea64fb5bd286eb98d4011e/tinker-build/tinker-patch-lib/src/main/java/org/jf/dexlib2/builder/BuilderMutableMethodImplementation.java#L1108-L1129","documentation":"ExceptionWithContext thrown when converting debug items to builder form: a debug item type (opcode) in the dex's debug info stream is not one of the known types (line number, source file, epilogue begin, etc.). The dexlib2 version bundled with Tinker cannot interpret it.","triggerScenarios":"A dex debug info item whose type byte is outside the handled DebugItemType constants, encountered while Tinker rewrites instructions and rebuilds debug info.","commonSituations":"Dex emitted by newer compilers/toolchains introducing new debug opcodes; obfuscators stripping or rewriting debug info in non-standard ways; corrupted debug sections.","solutions":["Upgrade Tinker so its dexlib2 knows the newer debug item types","Disable debug info in the offending build (minify with debug info stripped, or -g:none style options) and regenerate the patch","Rebuild the base apk with a stable toolchain version and re-diff"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    // dex rewrite involving debug info\n} catch (org.jf.util.ExceptionWithContext e) {\n    if (String.valueOf(e.getMessage()).startsWith(\"Invalid debug item type\")) {\n        // strip debug info from the offending build or upgrade Tinker\n    } else { throw e; }\n}","preventionTips":["Consider disabling debug info in release builds that will be hotpatched","Upgrade Tinker alongside compiler upgrades"],"tags":["dexlib2","dex","debug-info","version-mismatch","patch-build"],"backgroundTag":null,"analyzedSha":"1b7ea02c239840f563ea64fb5bd286eb98d4011e","analyzedAt":"2026-08-14T15:16:52.110Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}