Maven needed when generating Google App Engine bac

2019-03-01 11:27发布

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?

5条回答
虎瘦雄心在
2楼-- · 2019-03-01 11:44

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

查看更多
Juvenile、少年°
3楼-- · 2019-03-01 11:52

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

查看更多
成全新的幸福
4楼-- · 2019-03-01 11:56

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
查看更多
Rolldiameter
5楼-- · 2019-03-01 11:56

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.

查看更多
Evening l夕情丶
6楼-- · 2019-03-01 12:04

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

查看更多
登录 后发表回答