Thursday, February 28, 2013

Building Android application with Maven -- Unknown packaging APK

Should have been an easy thing. However, I spent my own 15 minutes because of not following rules. So here they are for starting up with maven and android:

  1. Read the Getting Started here http://code.google.com/p/maven-android-plugin/wiki/GettingStarted
  2. Create your own pom.xml, copying one from one of the samples. Samples can be downloaded also from Google code: http://code.google.com/p/maven-android-plugin/wiki/Samples
After performing these steps, I was unable to proceed, unfortunately. I had an error from maven build saying that my pom is not correct - looks like it did not pick up the android plugin, and thus did not understand the apk packaging. 

Unknown packaging: apk @ line 15, column 16

So i started lurking around and got the difference soon. I missed a single line in declaring a build plugin. Without the element, maven is not picking the new packaging. Oh, and also - the plugin requires maven 3.0.3 or newer. 

This is my entire Build section:

Build/plugins section:
Dependencies section:

Saturday, February 23, 2013

How to build gwt 2.4 now -- if errors in build

Okay, so the goal is to build Google Web Toolkit of version 2.4 now - when 2.5 is a  current stable. Issues seems to be fairly easy, but unfortunately -- fails from the first approach. Continuing tradition of writing memos for future, here it goes:

  1. http://google-web-toolkit.googlecode.com/svn/releases/2.4/ - Main GWT source, release 2.4, checkout with subersion.
  2. http://google-web-toolkit.googlecode.com/svn/tools/ - GWT-tools, some binary dependencies required for building.
    Trick is that they are versioned in a streamlined manner, and no-one leaves a note about which version of the tools does particular version of GWT require to build.
    So - to note, for GWT release 2.4 Tools rev 10417 are required. Do update Tools repo to this revision. 
  3. Next step is straightforward - just set GWT_TOOLS environment variable to point to the tools working copy contianing rev 10417, descend into the GWT 2.4 release working copy, and issue ant.

    It did not work for me
    [gwt.javac] /home/lexaux/work/gwt/2_4/user/src/com/google/web/bindery/requestfactory/shared/impl/FindRequest.java:34: error: name clash: find(EntityProxyId) in FindRequest and find(EntityProxyId) in RequestContext have the same erasure, yet neither overrides the other
    [gwt.javac]   Request find(EntityProxyId proxy);

    Which is fairly weird, I thought, as ant explicitly sets language and class output level.
    After about a day of search, I just tried to downgrade my JDK to version 6 -- and voila; it worked. Looks like there is a change in generic treatment which stopped compilation.
After successful build, you can obtain results in build/lib - here's gwt-dev.jar and gwt-user.jar