Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>It appears I solved the problem.</p> <p>I don't know if I missed a step when reading about how to use the nbandroid plugin, but the generated build-impl.xml doesn't seem to include any libraries I add with NetBeans when creating the APK.</p> <p>This is the incriminating piece of ant script:</p> <pre><code>&lt;target depends="init,compile,-pre-pre-jar,-pre-jar" name="-dex"&gt; &lt;exec executable="${dx}" failonerror="true"&gt; &lt;arg value="--dex"/&gt; &lt;arg value="--output=${basedir}/${intermediate.dex}"/&gt; &lt;arg value="--positions=lines"/&gt; &lt;arg path="${build.classes.dir}"/&gt; &lt;/exec&gt; &lt;/target&gt; </code></pre> <p>The library is included and the error mentioned in my question disappears if I add this last argument:</p> <pre><code>&lt;arg path="${external.libs.dir}"/&gt; </code></pre> <p>With <code>external.libs.dir</code> pointing to the directory containing the library's jar.</p> <p>Thanks to Christopher for making me look at the build.xml generated by the Android command line tools (the script generated when creating an Android project in NetBeans with the nbandroid plugin is quite different).</p> <hr /> <p>Addendum: Since I'm talking about NetBeans, another way of doing this is by overriding the <code>-pre-jar</code> target in the project's build.xml, instead of the above change to build-impl.xml. This is done by adding the following to build.xml:</p> <pre><code>&lt;target name="-pre-jar"&gt; &lt;copy todir="${build.classes.dir}"&gt; &lt;fileset dir="${external.libs.dir}" /&gt; &lt;/copy&gt; &lt;/target&gt; </code></pre> <p>This way, the library's jar is present along with the built classes, and automatically included.</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.
    3. 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