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?
maven is not shipped with AS - you have to install it
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
Linux Solution
You have to install maven & Google Cloud messaging for Android.
From terminal:
Then inside Android Studio:
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.
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