Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <blockquote> <p><strong><em>1) a reliable way to see if a certain class/jar/whatever was packaged up into my apk, as the steps to get to this point in my app are long and complicated right now</em></strong></p> </blockquote> <p>Build project from command-line (i.e. mvn clean install), maven will output verbose logs during every single phase/goal of build, in the dex goal, you can see something like this:</p> <blockquote> <p>[INFO] --- android-maven-plugin:3.1.1:dex (default-dex) @ myproject ---<br> [INFO] C:\Program Files\Java\jdk1.6.0_21\jre\bin\java [-Xmx1024M, -jar, C:\Progr am Files\Android\android-sdk-r16\platform-tools\lib\dx.jar, --dex, --output=C:\workspace\myproject\target\classes.dex, C:\workspace\myproject\target\classes, C:\maven\repository\cocos2d_android\cocos2d_android\1.0.0-SNAPSHOT\cocos2d_android-1.0.0-SNAPSHOT.apklib, C:\maven\repository\com\google\code\gson\gson\1.7.1\gson-1.7.1.jar, ... ...]</p> </blockquote> <p>The Android Library Project is actually dex-ed as cocos2d_android-1.0.0-SNAPSHOT.apklib with some other regular jar library archives.</p> <hr> <blockquote> <p><strong><em>2) Something in the Manifest or pom.xml for either the main app or the library project seems to be missing - something needed to signal to Maven to pick up this other project - what is it?</em></strong></p> </blockquote> <p>It is ApkLib, which is simply a zip archive of the Android Library Project (src/, res/, AndroidManifest.xml and etc.). We usually create/implement our own Android Library Project with the dependant Android Project as multi-module maven project, however, this is not necessary in case if you need reference Android Library Project written by other developers. Thanks to the developer, android-maven-plugin has already supported non-Maven Android Library Projects, check out <a href="http://code.google.com/p/maven-android-plugin/wiki/ApkLib" rel="nofollow">Compatible with non-Maven Android Library Projects</a>:</p> <blockquote> <p>The generated .apklib file will have the layout of a standard Android/Eclipse library project. This means that regardless of your Maven layout, the layout inside the .apklib file will be that source code is in "src/" instead of "src/main/java/", but still interpreted correctly when used in an Android/Maven application project. This is to be compatible with non-Maven developers' library projects, which is important to grow the Android developer community.</p> <p><strong>Use other non-Maven developers' libraries</strong> </p> <p>It also means we can take any external Android library project zip file (from non-Maven developers) and do mvn install:install-file ... on it and simply start using it as a dependency.</p> <p><strong>Share your .apklib with non-Maven developers</strong> </p> <p>To share your .apklib file with a non-Maven developer, they will probably feel more comfortable if you rename it to .zip. They can then simply unpack it in a directory and use it from there.</p> </blockquote> <p>So the workaround is:</p> <ol> <li>Pack your Android Library Project into zip archive properly, then rename it to something.apklib.</li> <li>Install something.apklib into your Maven local repository by using mvn install:install-file.</li> <li><p>In any Android Project that requires Library dependency, simply using:</p> <pre><code>&lt;dependency&gt; &lt;groupId&gt;cocos2d_android&lt;/groupId&gt; &lt;artifactId&gt;cocos2d_android&lt;/artifactId&gt; &lt;version&gt;1.0.0-SNAPSHOT&lt;/version&gt; &lt;type&gt;apklib&lt;/type&gt; &lt;/dependency&gt; </code></pre></li> </ol> <p>Check out <a href="http://code.google.com/p/maven-android-plugin/wiki/Samples" rel="nofollow">Samples</a> on android-maven-plugin website to see how to use apklib properly.</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.
 

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