Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I'm a big Android fan but sometimes it's indefensible :(</p> <p>There's a clue in the error that indicates that the error concerns static initializers; it's the <code>&lt;clinit&gt;</code> "method" name in:</p> <pre><code>WARN/dalvikvm(2114): VFY: rejected Lcom/examplecompany/project/TidalStreams/Data/gTidalStreamsHourlyHW;.&lt;clinit&gt; ()V </code></pre> <p>This indicates that the error may have to do with a <code>static { ... }</code> initializer block, or initialization of some <code>static</code> class member.</p> <p>My class has a static array initialiser:</p> <pre><code> public static shcTidalStreamPointStruct[] gTidalStreamHourlyHW1 = new shcTidalStreamPointStruct[]{ new shcTidalStreamPointStruct("000A",48.766667,-10.066667,51.116667,1.316667,"89",95,0.8,0.4,125,0.9,0.4,172,0.7,0.4,216,0.7,0.4,242,0.8,0.4,261,0.9,0.4,281,0.7,0.4,305,0.7,0.4,339,0.6,0.3,14,0.6,0.3,58,0.6,0.3,71,0.7,0.3,91,0.7,0.4,"GB",0), new shcTidalStreamPointStruct("000B",49.533333,-9.983333,51.116667,1.316667,"89",122,0.6,0.3,166,0.8,0.4,192,0.9,0.4,213,0.9,0.5,239,0.9,0.5,255,0.9,0.5,286,0.9,0.4,330,0.7,0.4,9,0.9,0.4,38,1,0.5,52,1.1,0.5,68,0.9,0.5,104,0.6,0.3,"GB",0), new shcTidalStreamPointStruct("000C",48.898333,-9.163333,51.116667,1.316667,"89",102,0.4,0.2,118,0.6,0.3,172,0.7,0.4,197,0.7,0.4,212,0.7,0.4,250,0.7,0.4,283,0.5,0.3,321,0.3,0.2,337,0.5,0.3,13,0.7,0.4,33,0.7,0.4,54,0.5,0.3,98,0.4,0.2,"GB",0), </code></pre> <p>There are 283 elements.</p> <p>I built a test project with only this code and verified that on 2.2 and below, it fails. On 2.3 and above, it works.</p> <p>The problem is the number of lines in the initialiser! I took out one line at a time until I was left with 197 lines and it works!</p> <p>So as well as Java's 64k compilation unit limit, there is some undocumented limit (or bug) in the Android class loader related to the number of lines/size of the static initialisation.</p> <p>The fix was to further split my files to reduce the line count. Fugggllly....</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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