在 Android Studio 中生成 Google App Engine 后端时需要 Maven [英] Maven needed when generating Google App Engine backend in Android Studio

查看:26
本文介绍了在 Android Studio 中生成 Google App Engine 后端时需要 Maven的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我正在尝试将 Google App Engine 后端添加到我的应用中.我正在使用 Android Studio 0.3.0.当我尝试生成 App Engine 后端"时我收到以下错误:

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:

找不到有效的 maven 安装.也许你还没有安装 Maven 或者没有设置你的 Maven 路径

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

我有点不知所措,因为我认为 Maven 是默认安装的?有人知道吗?

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

推荐答案

我找到了解决方案.您必须将环境变量 M2_HOME 设置为 maven 安装的路径.对我来说,那是C:\Program Files (x86)\Android\apache-maven-3.1.1".我从 AS 单独安装了 maven,但我认为如果您将 M2_HOME 指向 maven 的 AS 安装,这也会起作用.此外,您可以尝试将 maven 安装的 bin 文件夹添加到 Path 环境变量中.在我的例子中是C:\Program Files (x86)\Android\apache-maven-3.1.1\bin".

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".

最新版本的 AS 中似乎存在错误.您必须使用环境变量显式设置路径,否则它将无法工作.在 Settings -> Maven(检查覆盖后)中设置路径不起作用.这是问题的链接:https://code.google.com/p/android/issues/detail?id=61783

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

这篇关于在 Android Studio 中生成 Google App Engine 后端时需要 Maven的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆