Android Maven BUILD FAILED

Several days ago I've decided to assemble Android APKs with Maven under IntellijIDEA. I've found all the libraries, connected it and now I have pom.xml looks like this:

<?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>

But when I'm trying to run mvn3 install, I've get error:

[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]

Anyone faced that?

EDIT: All the messages are printed after the TESTS section

Answers


Have you tried to execute the command giving the error in a shell? This should give you more details on where and what appens... here is the reported command having a return code 1 (error) from your install report:

$ /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

Are you developing under unix?

I got the same error, because I copied the Android SDK binaries from windows to linux, but forgot to install the linux specific binaries (provided at http://developer.android.com/sdk/index.html )


Need Your Help

Difference between mobile agent and web crawlers

web-crawler user-agent agent distributed-system

Can someone tell me the exact difference between mobile agents and web crawlers?

Parse XML from URL

xml web-services axapta x++

I'm trying to use Google Maps to calculate the distance between 2 points.I have the following url :