{"record":{"id":"348d8f5f9decf09b","repo":"skylot/jadx","slug":"unknown-var-type-for","errorCode":null,"errorMessage":"Unknown var type for: {}","messagePattern":"Unknown var type for: (.+?)","errorType":"exception","errorClass":"JadxRuntimeException","httpStatus":null,"severity":"error","filePath":"jadx-core/src/main/java/jadx/core/dex/visitors/MethodInvokeVisitor.java","lineNumber":425,"sourceCode":"\t\t\tif (literalArg.getLiteral() == 0) {\n\t\t\t\tif (type.isObject() || type.isArray()) {\n\t\t\t\t\t// null\n\t\t\t\t\treturn ArgType.UNKNOWN_OBJECT;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (type.isPrimitive() && !arg.contains(AFlag.EXPLICIT_PRIMITIVE_TYPE)) {\n\t\t\t\treturn ArgType.INT;\n\t\t\t}\n\t\t\treturn arg.getType();\n\t\t}\n\t\tif (arg instanceof RegisterArg) {\n\t\t\treturn arg.getType();\n\t\t}\n\t\tif (arg instanceof InsnWrapArg) {\n\t\t\tInsnWrapArg wrapArg = (InsnWrapArg) arg;\n\t\t\treturn getInsnCompilerType(arg, wrapArg.getWrapInsn());\n\t\t}\n\t\tthrow new JadxRuntimeException(\"Unknown var type for: \" + arg);\n\t}\n\n\tprivate static ArgType getInsnCompilerType(InsnArg arg, InsnNode insn) {\n\t\tswitch (insn.getType()) {\n\t\t\tcase CAST:\n\t\t\tcase CHECK_CAST:\n\t\t\t\treturn ((IndexInsnNode) insn).getIndexAsType();\n\n\t\t\tdefault:\n\t\t\t\tif (insn.getResult() != null) {\n\t\t\t\t\treturn insn.getResult().getType();\n\t\t\t\t}\n\t\t\t\treturn arg.getType();\n\t\t}\n\t}\n}\n","sourceCodeStart":407,"sourceCodeEnd":442,"githubUrl":"https://github.com/skylot/jadx/blob/e738a26571d02919f01df40de93bc9a44dee4e18/jadx-core/src/main/java/jadx/core/dex/visitors/MethodInvokeVisitor.java#L407-L442","documentation":"Thrown by MethodInvokeVisitor.getCompilerVarType() when an InsnArg is not one of the three handled subtypes: LiteralArg, RegisterArg, or InsnWrapArg. The method tries to determine the 'compiler type' of an argument for cast resolution; encountering an unrecognised argument subclass means a new instruction-arg type was introduced that this method does not yet handle.","triggerScenarios":"getCompilerVarType(arg) is called for an argument during invoke-visitor processing. The arg fails all instanceof checks (not LiteralArg, not RegisterArg, not InsnWrapArg) and falls through to the throw. This indicates an unexpected InsnArg subclass in the argument position.","commonSituations":"Usually a jadx internal issue — a new InsnArg variant was produced by a visitor but getCompilerVarType was not updated. Rare for end users; would typically appear after a jadx upgrade that introduces a new arg type. Can surface with unusual instruction combinations.","solutions":["Upgrade jadx (or if already on latest, check if this is a known regression and downgrade).","Catch JadxRuntimeException per class/method and continue.","Report the issue with the InsnArg class name and toString() from the error message — this is likely a jadx bug.","Try disabling the MethodInvokeVisitor or related invoke-processing passes."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    javaClass.decompile();\n} catch (JadxRuntimeException e) {\n    LOG.warn(\"Unknown arg type in {}: {}\", javaClass.getName(), e.getMessage());\n}","preventionTips":["Upgrade jadx or check for regressions — this is likely an internal bug.","Isolate per-class with try-catch.","Report the InsnArg subclass name from the error to the jadx project.","Try disabling MethodInvokeVisitor or related passes via settings."],"tags":["jadx","decompiler","method-invoke","type-resolution","instruction-arg","internal-bug"],"backgroundTag":null,"analyzedSha":"e738a26571d02919f01df40de93bc9a44dee4e18","analyzedAt":"2026-08-14T00:10:24.238Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}