gpt4 book ai didi

java - Android Maven 构建失败

转载 作者:行者123 更新时间:2023-11-29 22:16:37 24 4
gpt4 key购买 nike

几天前,我决定在 IntellijIDEA 下使用 Maven 组装 Android APK。我已经找到所有的库,连接它,现在我的 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>com.example</groupId>
<artifactId>helloflashlight</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>apk</packaging>
<name>HelloFlashlight</name>

<dependencies>

<dependency>
<groupId>android</groupId>
<artifactId>android</artifactId>
<version>2.2_r3</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>com.google.android.maps</groupId>
<artifactId>maps</artifactId>
<version>8_r2</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>com.google.http-client</groupId>
<artifactId>google-http-client</artifactId>
<version>1.6.0-beta</version>
</dependency>

<dependency>
<groupId>com.google.http-client</groupId>
<artifactId>google-http-client-extensions-android2</artifactId>
<version>1.6.0-beta</version>
</dependency>

<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>10.0.1</version>
</dependency>

<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>2.0</version>
</dependency>

<dependency>
<groupId>com.bugsense.trace</groupId>
<artifactId>bugsense-trace</artifactId>
<version>1.1.2</version>
<scope>system</scope>
<systemPath>${project.basedir}/libs/bugsense-trace-1-1-2.jar</systemPath>
</dependency>

</dependencies>

<build>

<finalName>${project.artifactId}</finalName>
<sourceDirectory>src</sourceDirectory>

<pluginManagement>
<plugins>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<version>3.0.0</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 or api level (api level 4 = platform 1.6)-->
<platform>8</platform>
</sdk>
</configuration>
</plugin>
</plugins>
</build>

但是当我尝试运行 mvn3 install 时,出现错误:

[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 18.123s
[INFO] Finished at: Mon Nov 28 11:24:55 YEKT 2011
[INFO] Final Memory: 22M/255M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.0.0:dex (default-dex) on project helloflashlight: MojoExecutionException: ANDROID-040-001: Could not execute: Command = /bin/sh -c cd /home/dmitry/projects/flash/android && /usr/lib/jvm/jdk1.7.0/jre/bin/java -jar /home/dmitry/android-sdk/platform-tools/lib/dx.jar --dex --output=/home/dmitry/projects/flash/android/target/classes.dex /home/dmitry/.m2/repository/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar /home/dmitry/.m2/repository/org/khronos/opengl-api/gl1.1-android-2.1_r1/opengl-api-gl1.1-android-2.1_r1.jar /home/dmitry/.m2/repository/joda-time/joda-time/2.0/joda-time-2.0.jar /home/dmitry/.m2/repository/xerces/xmlParserAPIs/2.6.2/xmlParserAPIs-2.6.2.jar /home/dmitry/.m2/repository/junit/junit/4.8.2/junit-4.8.2.jar /home/dmitry/.m2/repository/org/codehaus/jackson/jackson-core-asl/1.9.1/jackson-core-asl-1.9.1.jar /home/dmitry/.m2/repository/com/google/android/android/2.1.2/android-2.1.2.jar /home/dmitry/.m2/repository/com/google/code/findbugs/jsr305/1.3.9/jsr305-1.3.9.jar /home/dmitry/projects/taxi/android/target/classes /home/dmitry/.m2/repository/com/google/guava/guava/10.0.1/guava-10.0.1.jar /home/dmitry/.m2/repository/org/apache/httpcomponents/httpclient/4.0.3/httpclient-4.0.3.jar /home/dmitry/.m2/repository/org/apache/httpcomponents/httpcore/4.0.1/httpcore-4.0.1.jar /home/dmitry/.m2/repository/com/google/protobuf/protobuf-java/2.2.0/protobuf-java-2.2.0.jar /home/dmitry/.m2/repository/com/google/code/gson/gson/1.7.1/gson-1.7.1.jar /home/dmitry/.m2/repository/commons-codec/commons-codec/1.3/commons-codec-1.3.jar /home/dmitry/.m2/repository/org/json/json/20080701/json-20080701.jar /home/dmitry/.m2/repository/com/google/http-client/google-http-client-extensions-android2/1.6.0-beta/google-http-client-extensions-android2-1.6.0-beta.jar /home/dmitry/.m2/repository/com/google/http-client/google-http-client/1.6.0-beta/google-http-client-1.6.0-beta.jar /home/dmitry/.m2/repository/xpp3/xpp3/1.1.4c/xpp3-1.1.4c.jar, Result = 1 -> [Help 1]

有人遇到过吗?

编辑:所有消息都在测试部分之后打印

最佳答案

您是否尝试在 shell 中执行给出错误的命令?这应该为您提供更多关于附加位置和附加内容的详细信息......这是从您的安装报告中返回代码 1(错误)的报告命令:

$ /bin/sh -c cd /home/dmitry/projects/flash/android && /usr/lib/jvm/jdk1.7.0/jre/bin/java -jar \
/home/dmitry/android-sdk/platform-tools/lib/dx.jar --dex --output=/home/dmitry/projects/flash/android/target/classes.dex \
/home/dmitry/.m2/repository/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar
/home/dmitry/.m2/repository/org/khronos/opengl-api/gl1.1-android-2.1_r1/opengl-api-gl1.1-android-2.1_r1.jar
/home/dmitry/.m2/repository/joda-time/joda-time/2.0/joda-time-2.0.jar \
/home/dmitry/.m2/repository/xerces/xmlParserAPIs/2.6.2/xmlParserAPIs-2.6.2.jar \
/home/dmitry/.m2/repository/junit/junit/4.8.2/junit-4.8.2.jar \
/home/dmitry/.m2/repository/org/codehaus/jackson/jackson-core-asl/1.9.1/jackson-core-asl-1.9.1.jar \
/home/dmitry/.m2/repository/com/google/android/android/2.1.2/android-2.1.2.jar \
/home/dmitry/.m2/repository/com/google/code/findbugs/jsr305/1.3.9/jsr305-1.3.9.jar \
/home/dmitry/projects/taxi/android/target/classes \
/home/dmitry/.m2/repository/com/google/guava/guava/10.0.1/guava-10.0.1.jar \
/home/dmitry/.m2/repository/org/apache/httpcomponents/httpclient/4.0.3/httpclient-4.0.3.jar \
/home/dmitry/.m2/repository/org/apache/httpcomponents/httpcore/4.0.1/httpcore-4.0.1.jar \
/home/dmitry/.m2/repository/com/google/protobuf/protobuf-java/2.2.0/protobuf-java-2.2.0.jar \
/home/dmitry/.m2/repository/com/google/code/gson/gson/1.7.1/gson-1.7.1.jar \
/home/dmitry/.m2/repository/commons-codec/commons-codec/1.3/commons-codec-1.3.jar \
/home/dmitry/.m2/repository/org/json/json/20080701/json-20080701.jar \
/home/dmitry/.m2/repository/com/google/http-client/google-http-client-extensions-android2/1.6.0-beta/google-http-client-extensions-android2-1.6.0-beta.jar \
/home/dmitry/.m2/repository/com/google/http-client/google-http-client/1.6.0-beta/google-http-client-1.6.0-beta.jar \
/home/dmitry/.m2/repository/xpp3/xpp3/1.1.4c/xpp3-1.1.4c.jar

关于java - Android Maven 构建失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8292213/

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