gpt4 book ai didi

java - Maven 无法执行 objective-c om.jayway.maven.plugins.android. Generation2

转载 作者:太空宇宙 更新时间:2023-11-04 15:14:22 26 4
gpt4 key购买 nike

我想要一个简单的 android hello world 程序,使用 maven。这是我的 pom.xml 文件

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>appzoyfoo141</groupId>
<artifactId>ekanta</artifactId>
<version>1.0.0</version>
<packaging>apk</packaging>
<name>ekanta</name>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<platform.version>4.1.1.4</platform.version>
<android.plugin.version>3.1.1</android.plugin.version>
</properties>

<dependencies>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>android</artifactId>
<version>4.1.1.4</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<finalName>${project.artifactId}</finalName>
<pluginManagement>
<plugins>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<version>${android.plugin.version}</version>
<extensions>true</extensions>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<configuration>
<sdk>
<platform>17</platform>
<path>${ANDROID_HOME}</path>
</sdk>
</configuration>
</plugin>
</plugins>
</build>
</project>

但是在尝试运行 pom.xml 时右键单击 pom.xml->runas->maven test.. 出现此错误

Failed to execute goal com.jayway.maven.plugins.android.generation2`..Can anybody plz help me..thanks  i am getting this error in console`[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.613s
[INFO] Finished at: Thu Jan 09 14:47:46 IST 2014
[INFO] Final Memory: 6M/15M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.1.1:generate-sources (default-generate-sources) on project ekanta: No Android SDK path could be found. You may configure it in the plugin configuration section in the pom file using <sdk><path>...</path></sdk> or <properties><android.sdk.path>...</android.sdk.path></properties> or on command-line using -Dandroid.sdk.path=... or by setting environment variable ANDROID_HOME -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException`

最佳答案

在尝试构建 Android Bootstrap 项目时,我在 com.jayway.maven 插件中遇到了同样的问题。
我可以通过进入 pom.xml 属性部分并添加我的 ANDROID sdk 路径来解决此问题。

<properties>
<abs.version>4.3.1</abs.version>
<dagger.version>1.0.1</dagger.version>
<otto.version>1.3.4</otto.version>
<gson.version>2.2.4</gson.version>
<menudrawer.version>3.0.2</menudrawer.version>
<android.sdk.path>C:\Android\adt-bundle-windows-x86_64-20131030\sdk</android.sdk.path>
</properties>

我最初让它指向我的 JAVA SDK,这导致它失败 - 您需要将其指向您的 ANDROID sdk。

关于java - Maven 无法执行 objective-c om.jayway.maven.plugins.android. Generation2,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21015897/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com