<div dir="ltr">Hi, <div><br></div><div>I don't know if this has been discussed before, but while developping my android app with graphhopper support I have hit the infamous dalvik error : </div><div>Conversion to Dalvik format failed with error 2 <br>
</div><div>trouble writing output: Too many methods: 72332; max is 65536. By package:<br></div><div><br></div><div>As per stackoverflow and android coummunity this is due to a too large codebase for my app = too many methods. </div>
<div><br></div><div>The error log gives me a method count per package and it seems the gnu trove which is used by graphhopper is very greedy in that domain. for example the error log give me </div><div><br></div><div><div>
446 gnu.trove</div><div> 3066 gnu.trove.decorator</div><div> 8 gnu.trove.function</div><div> 13 gnu.trove.impl</div><div> 1139 gnu.trove.impl.hash</div><div> 2658 gnu.trove.impl.sync</div><div> 3010 gnu.trove.impl.unmodifiable</div>
<div> 404 gnu.trove.iterator</div><div> 2 gnu.trove.iterator.hash</div><div> 339 gnu.trove.list</div><div> 602 gnu.trove.list.array</div><div> 674 gnu.trove.list.linked</div><div> 1763 gnu.trove.map</div><div>
798 gnu.trove.map.custom_hash</div><div> 8147 gnu.trove.map.hash</div><div> 72 gnu.trove.procedure</div><div> 2 gnu.trove.procedure.array</div><div> 28 gnu.trove.queue</div><div> 175 gnu.trove.set</div><div>
396 gnu.trove.set.hash</div><div> 56 gnu.trove.stack</div><div> 133 gnu.trove.stack.array</div><div> 6 gnu.trove.strategy</div></div><div><br></div><div>TOTAL : 23'397 methods just for trove. WOW ! </div><div>
<br></div><div><br></div><div><br></div><div> 23'397 methods is almost one third of what is allowed by dalvik VM for a dex file. So once you app gets a little complex and you want to use graphhopper the limit can be reached quite easily. <br>
</div><div><br></div><div><br></div><div><div>Now my question is : is there a way to avoid trove in graphhopper for example by replaceing trove collections by standard java collections ?</div><div>Or would it be possible to find an alternate lighter (shrinked) )version of trove or another collections library. </div>
<div>Would there be a huge performace difference ? </div></div><div><br></div><div><br></div><div>Thank you for your help. I'm a bit stuck here. </div><div><br></div><div>Cheers, </div><div><br></div><div>Alex</div><div>
<br></div><div><br></div><div><br></div></div>