Showing posts with label android. Show all posts
Showing posts with label android. Show all posts

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: