If you find yourself with a Maven Android project which builds fine from mvn command line but gives errors in eclipse the problem may be this:
After a Maven / Update Project, your Eclipse build compliance is updated to what is found in the pom. Without need for “maven-compiler-plugin”, it uses the oldest level.
In my case, Eclipse wasn’t happy with @Override annotations. This was because it was updating to Java compliance to 1.5 which doesn’t support annotations. The problem was more confusing because it didn’t give the correct error. (It said that my methods were not overriding anything – removing them then gave the error that I needed to override two methods.)
The solution is to put
in your plugins section. This will then determine what the “Maven / Update Project” will use to set Eclipse compliance. You will notice both an apk and jar will be build when using the command line mvn.
To use maven and eclipse with android projects:
You need the Maven Android Plugin (https://code.google.com/p/maven-android-plugin/) for your maven builds.
And the m2e-android plugin (http://rgladwell.github.io/m2e-android/) for eclipse – otherwise you will get a pom error (“Plugin execution not covered by lifecycle configuration”).
Follow the usual steps to convert a project to maven after m2e-androud plug-in is installed (rt click on project / configure / convert to maven). One thing, when following instructions on the m2e-android plugin page for installing the plugin, you will get multiple hits when searching in the marketplace, the one you want is “Android Configurator for M2E”.
Eclipse puts apk in bin/, mvn puts apk in target/
Obviously this could all change and is only correct at time of writing.
To get full system information from the terminal command line:
sudo lshw -html > info.html
If you’ve done something silly and can’t log on with your ubuntu user (in my case it was changing my ~/.pam_environment file to something invalid, then this is worth remembering:
Log on as guest.
Press Ctrl-Alt-F1 to get terminal mode
log on as yourself and make changes to the files.
Press Ctrl-Alt-F7 to exit terminal mode