{"record":{"id":"baeb114a83747673","repo":"skylot/jadx","slug":"null-array-element-type","errorCode":null,"errorMessage":"Null array element type","messagePattern":"Null array element type","errorType":"exception","errorClass":"JadxRuntimeException","httpStatus":null,"severity":"error","filePath":"jadx-core/src/main/java/jadx/core/dex/visitors/ModVisitor.java","lineNumber":578,"sourceCode":"\n\tprivate static InsnNode makeFilledArrayInsn(MethodNode mth, NewArrayNode newArrayNode, FillArrayInsn insn) {\n\t\tArgType insnArrayType = newArrayNode.getArrayType();\n\t\tArgType insnElementType = insnArrayType.getArrayElement();\n\t\tArgType elType = insn.getElementType();\n\t\tif (!elType.isTypeKnown()\n\t\t\t\t&& insnElementType.isPrimitive()\n\t\t\t\t&& elType.contains(insnElementType.getPrimitiveType())) {\n\t\t\telType = insnElementType;\n\t\t}\n\t\tif (!elType.equals(insnElementType) && !insnArrayType.equals(ArgType.OBJECT)) {\n\t\t\tmth.addWarn(\"Incorrect type for fill-array insn \" + InsnUtils.formatOffset(insn.getOffset())\n\t\t\t\t\t+ \", element type: \" + elType + \", insn element type: \" + insnElementType);\n\t\t}\n\t\tif (!elType.isTypeKnown()) {\n\t\t\tLOG.warn(\"Unknown array element type: {} in mth: {}\", elType, mth);\n\t\t\telType = insnElementType.isTypeKnown() ? insnElementType : elType.selectFirst();\n\t\t\tif (elType == null) {\n\t\t\t\tthrow new JadxRuntimeException(\"Null array element type\");\n\t\t\t}\n\t\t}\n\n\t\tList<LiteralArg> list = insn.getLiteralArgs(elType);\n\t\tInsnNode filledArr = new FilledNewArrayNode(elType, list.size());\n\t\tfilledArr.setResult(newArrayNode.getResult().duplicate());\n\t\tfor (LiteralArg arg : list) {\n\t\t\tIFieldInfoRef f = mth.getParentClass().getConstFieldByLiteralArg(arg);\n\t\t\tif (f != null) {\n\t\t\t\tInsnNode fGet = new IndexInsnNode(InsnType.SGET, f.getFieldInfo(), 0);\n\t\t\t\tfilledArr.addArg(InsnArg.wrapArg(fGet));\n\t\t\t\taddFieldUsage(f, mth);\n\t\t\t} else {\n\t\t\t\tfilledArr.addArg(arg.duplicate());\n\t\t\t}\n\t\t}\n\t\treturn filledArr;\n\t}","sourceCodeStart":560,"sourceCodeEnd":596,"githubUrl":"https://github.com/skylot/jadx/blob/e738a26571d02919f01df40de93bc9a44dee4e18/jadx-core/src/main/java/jadx/core/dex/visitors/ModVisitor.java#L560-L596","documentation":"Thrown by ModVisitor.makeFilledArrayInsn() when building a filled-array instruction and the element type cannot be determined. The method tries the instruction's declared element type, then the fill-array-data element type, and finally selectFirst(); if all fail and elType remains null/unknown, jadx cannot construct the array literal and aborts.","triggerScenarios":"makeFilledArrayInsn() is called with a NewArrayNode and FillArrayInsn. elType is not type-known, insnElementType is also not type-known (or elType.selectFirst() returns null). This means neither the array declaration nor the fill-array-data payload declares a concrete element type.","commonSituations":"Obfuscated or hand-crafted DEX where the new-array instruction and the fill-array-data payload have inconsistent or missing type information. Also possible with unusual array initialisation patterns from non-standard bytecode generators.","solutions":["Upgrade jadx — array-type resolution heuristics improve over time.","Catch JadxRuntimeException per class/method and skip.","Report the issue with the method and instruction offset from the error context.","Try decompiling with fallback mode or alternative settings."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    javaClass.decompile();\n} catch (JadxRuntimeException e) {\n    LOG.warn(\"Array element type unresolved in {}: {}\", javaClass.getName(), e.getMessage());\n}","preventionTips":["Upgrade jadx for array-type resolution improvements.","Isolate per-class with try-catch.","Report the method and instruction offset from the error context.","Try fallback decompilation mode for the specific class."],"tags":["jadx","decompiler","array","fill-array","type-resolution","bytecode"],"backgroundTag":null,"analyzedSha":"e738a26571d02919f01df40de93bc9a44dee4e18","analyzedAt":"2026-08-14T00:10:24.238Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}