{"record":{"id":"557503fb2a91a018","repo":"skylot/jadx","slug":"failed-to-process-method-for-inline","errorCode":null,"errorMessage":"Failed to process method for inline: {}","messagePattern":"Failed to process method for inline: (.+?)","errorType":"exception","errorClass":"JadxRuntimeException","httpStatus":null,"severity":"error","filePath":"jadx-core/src/main/java/jadx/core/dex/visitors/InlineMethods.java","lineNumber":80,"sourceCode":"\t\ttry {\n\t\t\tMethodInlineAttr mia = MarkMethodsForInline.process(callMth);\n\t\t\tif (mia == null) {\n\t\t\t\t// method is not yet loaded => force process\n\t\t\t\tmth.addDebugComment(\"Class process forced to load method for inline: \" + callMth);\n\t\t\t\tmth.root().getProcessClasses().forceProcess(callMth.getParentClass());\n\t\t\t\t// run check again\n\t\t\t\tmia = MarkMethodsForInline.process(callMth);\n\t\t\t\tif (mia == null) {\n\t\t\t\t\tmth.addWarnComment(\"Failed to check method for inline after forced process\" + callMth);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (mia.notNeeded()) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tinlineMethod(mth, callMth, mia, block, insn);\n\t\t} catch (Exception e) {\n\t\t\tthrow new JadxRuntimeException(\"Failed to process method for inline: \" + callMth, e);\n\t\t}\n\t}\n\n\tprivate void inlineMethod(MethodNode mth, MethodNode callMth, MethodInlineAttr mia, BlockNode block, InvokeNode insn) {\n\t\tInsnNode inlCopy = mia.getInsn().copyWithoutResult();\n\t\tif (replaceRegs(mth, callMth, mia, insn, inlCopy)) {\n\t\t\tIMethodDetails methodDetailsAttr = inlCopy.get(AType.METHOD_DETAILS);\n\t\t\t// replaceInsn replaces the attributes as well, make sure to preserve METHOD_DETAILS\n\t\t\tif (BlockUtils.replaceInsn(mth, block, insn, inlCopy)) {\n\t\t\t\tif (methodDetailsAttr != null) {\n\t\t\t\t\tinlCopy.addAttr(methodDetailsAttr);\n\t\t\t\t}\n\t\t\t\tupdateUsageInfo(mth, callMth, mia.getInsn());\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tmth.addWarnComment(\"Failed to inline method: \" + callMth);\n\t\t// undo changes to insn","sourceCodeStart":62,"sourceCodeEnd":98,"githubUrl":"https://github.com/skylot/jadx/blob/e738a26571d02919f01df40de93bc9a44dee4e18/jadx-core/src/main/java/jadx/core/dex/visitors/InlineMethods.java#L62-L98","documentation":"Thrown by InlineMethods.processInvokeInsn() as a catch-all wrapper around the method-inlining pipeline. Any exception (not just JadxRuntimeException) thrown during MarkMethodsForInline.process(), forceProcess, or inlineMethod is caught and re-thrown with a descriptive message identifying the call method. This means the root cause is the wrapped exception, not this message itself.","triggerScenarios":"An InvokeNode is processed, the resolved call method is a MethodNode eligible for inlining, and during inlineMethod() or replaceRegs() an exception occurs — e.g. register replacement failure, instruction copy error, or an invariant violation in the inlined method's body. The catch block wraps it with the callMth identifier.","commonSituations":"Methods with complex control flow being inlined into callers — deep nesting, unusual register mappings, or interactions with other visitor passes. Common in heavily optimised or obfuscated code where method inlining exposes edge cases.","solutions":["Inspect the wrapped cause exception (JadxRuntimeException.getCause()) to identify the real failure.","Upgrade jadx — inlining logic is regularly hardened.","Disable method inlining via jadx args to avoid the visitor entirely.","Catch JadxRuntimeException per class and skip; the method will remain as a call rather than inlined."],"exampleFix":"// before\ntry {\n    jadx.load();\n    jadx.save();\n} catch (JadxRuntimeException e) {\n    // root cause lost / batch aborts\n}\n\n// after\ntry {\n    jadx.load();\n    jadx.save();\n} catch (JadxRuntimeException e) {\n    Throwable root = e.getCause() != null ? e.getCause() : e;\n    LOG.error(\"Inline failed, cause: {}\", root.getMessage(), root);\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    javaClass.decompile();\n} catch (JadxRuntimeException e) {\n    Throwable cause = e.getCause() != null ? e.getCause() : e;\n    LOG.warn(\"Method inline failed in {}: {}\", javaClass.getName(), cause.getMessage(), cause);\n}","preventionTips":["Always inspect getCause() — the real failure is the wrapped exception.","Upgrade jadx for inlining-logic improvements.","If a specific method triggers it, disable method inlining via JadxArgs.","Isolate per-class with try-catch so one failure does not abort the batch."],"tags":["jadx","decompiler","method-inline","optimization","wrapper-exception"],"backgroundTag":null,"analyzedSha":"e738a26571d02919f01df40de93bc9a44dee4e18","analyzedAt":"2026-08-14T00:10:24.238Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}