pxb1988/dex2jar · error · RuntimeException

i have trouble to auto convert from

Error message

i have trouble to auto convert from 

What it means

Reached the default branch of IR2JConverter's auto-unboxing/conversion helper (around line 1074): the tool tries to insert the right cast+xxxValue() call to convert a boxed or typed value to a requested primitive, and the (from-type, to-type) pair is not one of the enumerated combinations (Object/Integer/I, Object/Long/J, Object/Double/D, etc.). The message appends the source type descriptor. It is a converter limitation on an unexpected type pair.

Solutions

  1. Upgrade dex2jar — broader boxed-type conversion pairs have been added across releases
  2. Report the type pair from the message plus the input dex so the conversion table can be extended
  3. Exclude the affected method/class to let the rest of the translation proceed
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at dex-translator/src/main/java/com/googlecode/d2j/converter/IR2JConverter.java:1074 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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

Appendix: source

Thrown at dex-translator/src/main/java/com/googlecode/d2j/converter/IR2JConverter.java:1074

            break;


        case "Ljava/lang/Object;J":
            asm.visitTypeInsn(CHECKCAST, "java/lang/Long");
            // pass through
        case "Ljava/lang/Long;J":
            asm.visitMethodInsn(INVOKEVIRTUAL, "java/lang/Long", "longValue", "()J", false);
            break;

        case "Ljava/lang/Object;D":
            asm.visitTypeInsn(CHECKCAST, "java/lang/Double");
            // pass through
        case "Ljava/lang/Double;D":
            asm.visitMethodInsn(INVOKEVIRTUAL, "java/lang/Double", "doubleValue", "()D", false);
            break;

        default:
            throw new RuntimeException("i have trouble to auto convert from " + provideType + " to " + expectedType + " currently");
        }
    }

    private void reBuildE1Expression(E1Expr e1, MethodVisitor asm) {
        accept(e1.getOp(), asm);
        switch (e1.vt) {
        case STATIC_FIELD: {
            FieldExpr fe = (FieldExpr) e1;
            asm.visitFieldInsn(GETSTATIC, toInternal(fe.owner), fe.name, fe.type);
            break;
        }
        case FIELD: {
            FieldExpr fe = (FieldExpr) e1;
            asm.visitFieldInsn(GETFIELD, toInternal(fe.owner), fe.name, fe.type);
            break;
        }
        case NEW_ARRAY: {
            TypeExpr te = (TypeExpr) e1;

View on GitHub (pinned to b5bda4fb49)