I hope someone can offer some insight on this problem. My build was
failing with a dex error. After I turned verbosity up to debug I got
the following:

Buildfile: build.xml
    [setup] Project Target: Android 1.6
    [setup] API level: 4
    [setup] WARNING: No minSdkVersion value set. Application will
install on all Android versions.

(snip)

-dex:
     [echo] Converting compiled files and external libraries into /
Users/newton/scratch/bin/classes.dex...
     [echo]
    [apply]
    [apply] trouble writing output:
    [apply] com.android.dx.util.ExceptionWithContext: shouldn't happen
    [apply]     at
com.android.dx.util.ExceptionWithContext.withContext(ExceptionWithContext.java:
46)
    [apply]     at
com.android.dx.dex.file.DebugInfoItem.place0(DebugInfoItem.java:79)
    [apply]     at
com.android.dx.dex.file.OffsettedItem.place(OffsettedItem.java:241)
    [apply]     at
com.android.dx.dex.file.MixedItemSection.placeItems(MixedItemSection.java:
312)
    [apply]     at com.android.dx.dex.file.DexFile.toDex0(DexFile.java:
525)
    [apply]     at com.android.dx.dex.file.DexFile.toDex(DexFile.java:
196)
    [apply]     at com.android.dx.command.dexer.Main.writeDex(Main.java:
406)
    [apply]     at com.android.dx.command.dexer.Main.run(Main.java:143)
    [apply]     at com.android.dx.command.dexer.Main.main(Main.java:120)
    [apply]     at com.android.dx.command.Main.main(Main.java:87)
    [apply] Caused by: java.lang.RuntimeException: shouldn't happen
    [apply]     at
com.android.dx.dex.file.DebugInfoEncoder.emitLocalsAtAddress(DebugInfoEncoder.java:
314)
    [apply]     at
com.android.dx.dex.file.DebugInfoEncoder.convert0(DebugInfoEncoder.java:
220)
    [apply]     at
com.android.dx.dex.file.DebugInfoEncoder.convert(DebugInfoEncoder.java:
155)
    [apply]     at
com.android.dx.dex.file.DebugInfoItem.encode0(DebugInfoItem.java:188)
    [apply]     at
com.android.dx.dex.file.DebugInfoItem.encode(DebugInfoItem.java:144)
    [apply]     at
com.android.dx.dex.file.DebugInfoItem.place0(DebugInfoItem.java:76)
    [apply]     ... 8 more
    [apply] ...while placing debug info for
com.sshtools.j2ssh.transport.publickey.SshPublicKey.getFingerprint:
()Ljava/lang/String;
    [apply] ...while placing
com.android.dx.dex.file.debuginfoi...@55bbe9aa
    [apply] ...while writing section 10
    [apply]


Here is the source of the class where it is failing to place debug
info:
package com.sshtools.j2ssh.transport.publickey;

import com.sshtools.j2ssh.util.Hash;
import java.security.NoSuchAlgorithmException;

public abstract class SshPublicKey {

    public abstract String getAlgorithmName();

    public abstract int getBitLength();

    public abstract byte[] getEncoded();

    public String getFingerprint() {
        try {
            Hash md5 = new Hash("MD5");
            md5.putBytes(getEncoded());

            byte[] digest = md5.doFinal();
            int bits = getBitLength();
            bits = (((bits % 8) != 0) ? (bits += (bits % 8)) : bits);

            String ret = String.valueOf(bits);

            for (int i = 0; i < digest.length; i++) {
                ret += (((i == 0) ? ":" : "") + " " +
                        Integer.toHexString(digest[i] & 0xFF));
            }

            return ret;
        } catch (NoSuchAlgorithmException nsae) {
            return null;
        }
    }

    public boolean equals(Object obj) {
        if (obj instanceof SshPublicKey) {
            return (getFingerprint().compareTo(((SshPublicKey)
obj).getFingerprint()) == 0);
        }

        return false;
    }

    public int hashCode() {
        return getFingerprint().hashCode();
    }

    public abstract boolean verifySignature(byte[] signature,
                                            byte[] exchangeHash)
throws InvalidSshKeySignatureException;
}


Clues?

thanks
M.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to