pxb1988/dex2jar · error · DexException

While accepting parameter annotation in parameter

Error message

While accepting parameter annotation in parameter: [%d]

What it means

DexException thrown from read_annotation_set_ref_list when reading one individual parameter's annotation set fails. The message identifies the zero-based parameter index j whose annotation item could not be decoded via read_annotation_set_item.

Solutions

  1. Check the cause for the exact decode failure at parameter index j
  2. Rebuild the dex with dx/d8 so annotation offsets are consistent
  3. Verify the dex structure with dexdump before converting
  4. Catch DexException to skip parameter annotations for that method
Defensive patterns

Strategy: try-catch

Try / catch

try {
    reader.accept(dmv);
} catch (DexException e) {
    logger.warn("parameter annotation read failed", e.getCause());
}

Prevention

When it happens

Trigger: The annotation_set_item offset for parameter j points to invalid or truncated data, or the annotation item references unknown types/elements, throwing inside read_annotation_set_item.

Common situations: Dexes rewritten by obfuscators/packers that corrupt annotation offsets, or hand-patched dex files; also seen converting apk built with exotic tools.

Understand the failure class

Background: "Invalid ... format", "must be in format X", "does not look like a ..." — invalid argument format errors across CLI tools and libraries — this error's family across 17 libraries.

Related errors


AI-assisted analysis of pxb1988/dex2jar@b5bda4fb49 (2026-09-08). Data as JSON: /api/errors/63cd23cfb3f12245. Report an issue: GitHub.

Appendix: source

Thrown at dex-reader/src/main/java/com/googlecode/d2j/reader/DexFileReader.java:1098

    }

    private void read_annotation_set_ref_list(int parameter_annotation_offset, DexMethodVisitor dmv) {
        ByteBuffer in = annotationSetRefListIn;
        in.position(parameter_annotation_offset);

        int size = in.getInt();
        for (int j = 0; j < size; j++) {
            int param_annotation_offset = in.getInt();
            if (param_annotation_offset == 0) {
                continue;
            }
            DexAnnotationAble dpav = dmv.visitParameterAnnotation(j);
            try {
                if (dpav != null) {
                    read_annotation_set_item(param_annotation_offset, dpav);
                }
            } catch (Exception e) {
                throw new DexException(e, "While accepting parameter annotation in parameter: [%d]", j);
            }
        }
    }

    /**
     * the size of class in dex file
     * 
     * @return class_defs_size
     */
    public final int getClassSize() {
        return class_defs_size;
    }

    static class BadOpException extends RuntimeException {

        private static final long serialVersionUID = 5354839427958139635L;

        public BadOpException(String fmt, Object... args) {

View on GitHub (pinned to b5bda4fb49)