Note that there are some explanatory texts on larger screens.

plurals
  1. POjava dx utility: UNEXPECTED TOP-LEVEL ERROR java.lang.ExceptionInInitializerError
    text
    copied!<p>I'm trying to convert a normal Java application library for use on Android. The library dates from Java 1.1 and has been maintained, improved, etc, all this time, and is in service on other platforms so it's unlikely that the source code is involved.</p> <p>Normally, due to the details of deployment, this library is not encapsulated in a jar, but is merely kept in a tree where CLASSPATH does its magic. However, for purposes of putting it on Android, a jar was created. That went fine - no warnings or errors.</p> <p>As there will be some new development - and therefore debugging - the step of processing through ProGuard was skipped - the time will come for that later.</p> <p>The error comes in the next step, running dx to convert it for use with Android. The processing proceeds without error until the fatal one described here. (There's one minor warning.)</p> <p>The error splash:</p> <pre><code>UNEXPECTED TOP-LEVEL ERROR: java.lang.ExceptionInInitializerError at java.io.ByteArrayOutputStream.expand(ByteArrayOutputStream.java:91) at java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:201) at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:244) at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:136) at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:113) at com.android.dx.command.dexer.Main.processOne(Main.java:247) at com.android.dx.command.dexer.Main.processAllFiles(Main.java:183) at com.android.dx.command.dexer.Main.run(Main.java:139) at com.android.dx.command.dexer.Main.main(Main.java:120) at com.android.dx.command.Main.main(Main.java:89) at com.spartacusrex.spartacuside.external.dx.main(dx.java:14) at dalvik.system.NativeStart.main(Native Method) Caused by: java.lang.UnsatisfiedLinkError: native_get at android.os.SystemProperties.native_get(Native Method) at android.os.SystemProperties.get(SystemProperties.java:47) at com.htc.profileflag.ProfileConfig.&lt;clinit&gt;(ProfileConfig.java:168) ... 12 more </code></pre> <p>The development environment is <a href="http://Terminal-IDE.com/" rel="nofollow">Terminal-IDE</a>. (<a href="http://code.google.com/p/terminal-ide/" rel="nofollow">Google code site here.</a>)</p> <p>I'm running Terminal-IDE v 2.02 - the very latest. My Android versions are:</p> <pre><code>Android 4.0.3 Software version 2.14.531.3 71ORD (the rest aren't likely pertinent, but more on request) </code></pre> <p><strong>EDIT - New Information</strong></p> <p>With the idea that there was something missing from the Terminal-IDE environment, I set about trying to run dx on a Windows 7 box running Eclipse. Eclipse <em>is</em> running DX somehow as its converting over the code from a plain .jar into something that actually runs as a part of an Android application. However, I was not able to get dx to run from the command line - it complains it can't find the source input file! (any clues?)</p> <p>Meanwhile, at someones' suggestion, I set about doing the whole build in the Terminal-IDE environment. That meant a little hacking to simplify the scenario, and also it kept failing on not finding java.RMI, so I commented those sections out - I presume there's an Android-Ready RMI library I can just point to? ...Continuing on, everything worked without error until I got to DX again and had a VERY SIMILAR error as reported above:</p> <pre><code>UNEXPECTED TOP-LEVEL ERROR: java.lang.ExceptionInInitializerError at com.android.dx.util.FileUtils.readFile(FileUtils.java:72) at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:139) at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:196) at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:127) at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:196) at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:127) at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:113) at com.android.dx.command.dexer.Main.processOne(Main.java:247) at com.android.dx.command.dexer.Main.processAllFiles(Main.java:183) at com.android.dx.command.dexer.Main.run(Main.java:139) at com.android.dx.command.dexer.Main.main(Main.java:120) at com.android.dx.command.Main.main(Main.java:89) at com.spartacusrex.spartacuside.external.dx.main(dx.java:14) at dalvik.system.NativeStart.main(Native Method) Caused by: java.lang.UnsatisfiedLinkError: native_get at android.os.SystemProperties.native_get(Native Method) at android.os.SystemProperties.get(SystemProperties.java:47) at com.htc.profileflag.ProfileConfig.&lt;clinit&gt;(ProfileConfig.java:168) ... 14 more </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload