MikeWallaceDev
MikeWallaceDev

Reputation: 1468

Maven needed when generating Google App Engine backend in Android Studio

AndroidDev

So I'm trying to add a Google App Engine backend to my app. I'm using Android Studio 0.3.0. When I try to "Generate App Engine Backend" I get the following error:

Could not find a valid installation of maven. Perhaps you have not installed Maven or have not setup your Maven paths

I'm a little at a lost because I thought that Maven was installed by default with AS? Does anybody have a clue?

Upvotes: 1

Views: 1640

Answers (5)

Ryan Heitner
Ryan Heitner

Reputation: 13632

I am currently on Studio 0.4.2

After lots of Googling I was still unable to resolve this. I have tried all suggested solutions the best answer I found was this

This is posted Jan 15 2014

"Yes, sorry this is a bug, however we're moving to a Gradle based build so in the future Maven wont be the build system that App Engine templates are realized (sic) with."

Google Issues for Android Studio


update on Mar 26th 2014 This has been moved to Gradle from Maven

Upvotes: 0

Orane
Orane

Reputation: 2261

Linux Solution

You have to install maven & Google Cloud messaging for Android.

From terminal:

sudo apt-get install maven

Then inside Android Studio:

  1. Tools > Android > SDK Manager
  2. Scroll down to Extras
  3. Check Google Cloud Messaging for Android
  4. Install

Upvotes: 1

user3138082
user3138082

Reputation:

Dec 26 2013 Maven 3.1.1 does not successfully complete the code generation, switch to Maven 3.0.5 for success ! This is for Android Studio 0.3.2 make sure you edit your PATH information as explained in Maven install.

Upvotes: 0

Xaver Kapeller
Xaver Kapeller

Reputation: 49817

I found a solution. You have to set the enviroment variable M2_HOME to the path to your maven installation. For me that was "C:\Program Files (x86)\Android\apache-maven-3.1.1". I have maven seperatly from AS but I think this would also work if you point M2_HOME towards the AS installation of maven. Additionally you can try to add the bin folder of you maven installation to the Path enviroment variable. In my case that was "C:\Program Files (x86)\Android\apache-maven-3.1.1\bin".

There seems to be a bug in the newest version of AS. You have to explicitly set the path with the enviroment variables otherwise it will not work. Setting the path in Settings -> Maven (after checking override) does not work. Here's the link to the issue: https://code.google.com/p/android/issues/detail?id=61783

Upvotes: 1

ligi
ligi

Reputation: 39529

maven is not shipped with AS - you have to install it

Upvotes: 0

Related Questions