My favorites | Sign in
Project Home
Search
for
GettingStarted  

Featured
Updated Aug 10, 2011 by ricardo.gladwell

This project has moved to Github

#summary Installation and usage instructions for Maven Integration for Android Development Tools.

Note: If you encounter any issues with Maven Integration for Android Development Tools specifically, please raise a defect ticket.

1. Before you start

Before you start you will need Eclipse Helios or Ganymede installed, as well as some additional Eclipse plug-ins. Instructions for installing these components can be found on the following sites:

Alternatively, you can install Maven Integration for Android Development Tools and it's dependencies can quickly be installed though the Eclipse Marketplace in Eclipse Helios by searching for "m2eclipse-android-integration" or just "android".

Finally, you can install Maven Integration for Android Development Tools directly via the update site:

2. Create Eclipse Project

Now you are ready to start using Maven Integration for Android Development Tools.

If you already have an Android project please follow these steps to set-up and configure your project correctly:

  1. Checkout and/or create your project in your Eclipse workspace normally.
  2. Click File > Import > Maven > Existing Maven Project > Next
  3. Browse to the checked out source of the project
  4. Click Finish

If you are starting with a new project you can use the Maven Android archetypes to create Android projects completely within Eclipse:

  1. In Eclipse select File -> New -> Project...
  2. Select Maven -> Maven Project and click "Next"
  3. Click "Next" again
  4. Click "Add Archetype..."
  5. In Archetype Group Id enter "de.akquinet.android.archetypes"
  6. In Archetype Artifact Id" enter "android-quickstart"
  7. In Archetype Version enter "1.0.5"
  8. Click "OK"
  9. Click Next
  10. Enter your desired project group and artefact ID, version and, optionally, set the "platform" property for the Android version (defaults to '7')
  11. Click Finish
  12. Right-click on new project and select Maven -> Update Project Configuration

The end result should look something like this:

Full details on how to create Maven Android projects manually can be found in the Maven Android Plugin Getting Started Guide.

Comment by shawn.la...@gmail.com, Feb 16, 2011

Ricardo, on this page step 3 does not seem to be necessary if you follow the steps you've described for using the Maven archetypes within Eclipse.

Comment by project member ricardo.gladwell, Feb 19, 2011

Thanks, Shawn, fixed.

Comment by rass...@gmail.com, Feb 23, 2011

Hi, I've followed the steps using The android-quickstart archetype after finishing importing the project to eclipse I didn't get the gen folder and I got an error on setContentView(R.layout.main); it could not find R.java

mvn clean install run with success from my eclipse.

I will appreciate your help guys :)

Comment by project member ricardo.gladwell, Feb 24, 2011

Please raise this as a defect rass...@gmail.com

Comment by nicholas...@gmail.com, Mar 17, 2011

the gen/R.java file is not available after step 11, but it appeared correctly for me after step 12 (Maven -> Update Project Configuration) - perhaps rass... missed this out?

Comment by kjetil.o...@gmail.com, Mar 28, 2011

I had the same problem as rass...@gmail.com; the gen/ folder did not appear in Eclipse when I imported an Android project (made with the android-quickstart archetype) and ran Maven -> Update Project Configuration.

After installing Eclipse Helios with the same versions of all plugins, this problem was fixed and the gen/ folder including R.java was added to the Package Explorer in Eclipse.

m2eclipse version 0.12. m2eclipse-android version 0.2.5.

Comment by romain.g...@gmail.com, Jul 5, 2011

I have the following problem when I try to install/uninstall m2eclipse-android-integration with eclipse MarketPlace? (Mac OS):

An error occurred while uninstalling session context was:(profile=epp.package.java, phase=org.eclipse.equinox.internal.p2.engine.phases.Uninstall, operand=R?org.eclipse.zest.core 1.2.0.v20101209-2020 --> null, action=org.eclipse.equinox.internal.p2.touchpoint.eclipse.actions.UninstallBundleAction?). Error while loading manipulator. Error while loading manipulator.

Comment by project member ricardo.gladwell, Jul 5, 2011

@romain please raise issues in the bug tracker or on the mailing list.

Comment by efi.merd...@gmail.com, Jul 21, 2011

I'm using Helios R2 64b on win 7 64b. When using the android-quickstart archetype I don't get any R file created, no matter how many times I'm running "Update Project Configuration".

In addition when using android-with-test I get the following error: "Can't rename Can't rename C:\Users\John\workspace\my" although the file is created. When trying to rename the directory by myself I also encounter a rename error, it looks like C:\Users\John\workspace\my\application-it\res\drawable-hdpi\icon.png is open by javaw.

Any idea what might be the problem ?

Comment by efi.merd...@gmail.com, Jul 21, 2011

Ok problem #1 solved by creating the project first using ADT and then applying maven. Problem #2 not yet.

Comment by project member ricardo.gladwell, Jul 22, 2011

What happens when you run you android maven build from the command line?

Comment by efi.merd...@gmail.com, Jul 22, 2011

Works just fine

Comment by project member ricardo.gladwell, Jul 25, 2011

Sorry you're still experiencing problems. We're releasing a new version of this plugin next weekend that completely changes the way we build APKs. If you could wait till then and re-test.

If you still get issues please raise this issue again on our new bug tracker:

https://github.com/rgladwell/m2e-android/issues

Comment by york.ye....@gmail.com, Jul 28, 2011

Same problem as rass...@gmail.com By doing File > Import > Maven > Existing Maven Project doesn't create the gen folder and R.java (error message "R cannot be resolved to avariable").

Has this been solved? or anyone knows any workaround to fix this error?

Comment by york.ye....@gmail.com, Jul 28, 2011

OK, the workaround is do a mvn clean install before File > Import > Maven > Existing Maven Project. mvn clean install generates the missing R.java under target\generated-sources\r, when you do the maven project import later, m2eclipse-android-plugin automatically create the gen folder and its contents. the last thing you need to do is set the Default Output Folder to <your-project>/target (where the apk file is created) in Build Path, otherwise Eclipse can't find apk file when runing emulator.

Comment by project member ricardo.gladwell, Jul 29, 2011

Or simply just run Maven -> Update Project Configuration.

Also this is NOT the forum to raise bugs or discuss general issues with m2eclipse-android-integration. Please open new issues here:

https://github.com/rgladwell/m2e-android/issues

Or join the mailing list and monitor that for responses.

Comment by zoghlami...@gmail.com, Aug 9, 2011

Hi all, When i have created a new Maven/Andoid project using the plugin m2eclipse-android-integration, i get these maven errors (related to the packaging type 'apk'):

Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-jar-plugin:2.3.1:jar (execution: default-jar, phase: process-classes).

Do you have any idea ???

Comment by project member ricardo.gladwell, Aug 10, 2011

Please see new site and getting started instructions here:

http://rgladwell.github.com/m2e-android/

In particular:

Open your POM and click on the "Plugin execution not covered by lifecycle configuration" error. This will give you the option to Discover new m2e connectors.

Select this and you should be automatically prompted to download and install the Android Connector.

Powered by Google Project Hosting