dex fails placing debug info

by Michael Newton » Tue, 20 Apr 2010 13:08:24 GMT

Sponsored Links
  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.


[echo] Converting compiled files and external libraries into /
[apply] trouble writing output:
[apply] shouldn't happen
[apply] at
[apply] at
[apply] at
[apply] at
[apply] at
[apply] at
[apply] at
[apply] at
[apply] at
[apply] at
[apply] Caused by: java.lang.RuntimeException: shouldn't happen
[apply] at
[apply] at
[apply] at
[apply] at
[apply] at
[apply] at
[apply] ... 8 more
[apply] ...while placing debug info for
[apply] ...while placing
[apply] ...while writing section 10

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

import com.sshtools.j2ssh.util.Hash;

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");

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;


dex fails placing debug info

by Dan Bornstein » Wed, 21 Apr 2010 07:33:11 GMT

 On Mon, Apr 19, 2010 at 4:26 PM, Michael Newton

This looks like a bug in dx (the tool that turns .class files into
.dex files). Since compilers can produce different output for the same
source, it's much more interesting to see the compiled .class file
that is being processed.

Please file a bug by following the directions at
<> ;. Again, in this case,
attaching the .class file that fails is much better than just
including the source text.

As a workaround, you might try compiling without debugging info (that
is, removing "-g" from your javac command line). You might also try
splitting the failing method (getFingerPrint) in various places (e.g.,
put the try body in a separate method), as that will change the
emitted code and has a good chance of avoiding the problem.




Sponsored Links

dex fails placing debug info

by Michael Newton » Wed, 21 Apr 2010 23:26:17 GMT

 I fixed this - this code is where the problem is:

            int bits = getBitLength();
            bits = (((bits % 8) != 0) ? (bits += (bits % 8)) : bits);

When I assigned the result of the expression in the second line to a
new variable instead of back to int bits, the problem went away.

The clue was in 
- may be the same kind of issue.



dex fails placing debug info

by fadden » Fri, 23 Apr 2010 04:10:41 GMT


Can you attach the failing and non-failing .class files to that bug?


Other Threads

1. debugging the (suddenly) crippling slowness of the emulator

  the reason i posted in some frustration was that, from the time i
installed the emulator, it worked every time.  it took 2-3 minutes on
average to come up but it never, ever hung.  and that's the emulator i
installed from the latest SDK tarball.

  that's when i decided to git checkout what i *thought* was the froyo
code base (i have seen been enlightened that it isn't) and build it,
and i ran the emulator from *that*.  and when i went back to the
original emulator, it started{*filter*} incessantly.  several times in a
row.  at one point, i left it running bootanimation for an hour, left,
came back and it was still doing that.  i started to think it was
because i'd built and run a different emulator that had somehow
screwed with some settings.

  in any event, for no reason, the tarball-based emulator is now
running properly again.  go figure.  i can't explain it.


p.s.  i'm still interested in building from the git development branch
when it becomes available.  will that be the "froyo" branch when it
appears?  as in, "froyo" won't just be a fixed release tag, it will be
the branch heading towards the next release?  thanks.


Robert P. J. Day                               Waterloo, Ontario, CANADA

            Linux Consulting, Training and Kernel Pedantry.

Web page:                                           http://www.***.com/ 
Twitter:                                        http://www.***.com/ 


2. Disable preference focus

As a use in my preferenceactivity I created a custom preference
(extended Preference class) which holds a progressbar. As this
preference is merely to show activity status, I don't want it to be
focusable nor selectable; it should be skipped when the user browses
through the preference items. How can I achieve this?

adding "android:enabled=false" to the XML definition seems to only
change the background color to gray; it still receives focus.


3. Spreading the word about Android (in Dublin) anyone?

4. My app in the Market: What does "FC on new install" mean?

5. Cross compile error

6. Cross compilation erros

7. Script to Capture Android Instrumentation Output and Convert to XML