Note that there are some explanatory texts on larger screens.

plurals
  1. POCan't build multiple Android dex files with Ant from external jars
    text
    copied!<p>I'm developing an Android app that requires multiple libraries (for Facebook, Google Maps v2 and Quickblox among others), resulting in a method amount overflow that goes over the 64K limit:</p> <pre><code>Unable to execute dex: method ID not in [0, 0xffff]: 65536 Conversion to Dalvik format failed: Unable to execute dex: method ID not in [0, 0xffff]: 65536 </code></pre> <p>As I can't do without any of those libraries, I looked for a solution for the method limit bug. I found a popular blog entry from Android Developers, where a source code division is recommended. (The blog entry I'm talking about can be found here: <a href="http://android-developers.blogspot.com.es/2011/07/custom-class-loading-in-dalvik.html">http://android-developers.blogspot.com.es/2011/07/custom-class-loading-in-dalvik.html</a>). I've been trying this solution with no success.</p> <p>The problem I have now is that the biggest amount of code is not in my app itself, but in the required libraries, so I have to spread those libraries among the different dex files I must load in my app. My knowledge of Ant is very limited, and what I'd like to know is what I should write in my build.xml file to make dex copy each library where I want:</p> <pre><code> &lt;!-- Primary dex to include my source code and some libraries. --&gt; &lt;copy todir="${out.classes.absolute.dir}.1" &gt; &lt;fileset dir="${out.classes.absolute.dir}" &gt; ... &lt;/fileset&gt; &lt;/copy&gt; &lt;!-- Secondary dex to include some other libraries. --&gt; &lt;copy todir="${out.classes.absolute.dir}.2" &gt; &lt;fileset dir="${out.classes.absolute.dir}" &gt; ... &lt;/fileset&gt; &lt;/copy&gt; </code></pre> <p>Any help would be truly appreciated. Thanks in advance, kind regards!</p>
 

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