kerasking / maven-android-plugin

Automatically exported from code.google.com/p/maven-android-plugin
0 stars 0 forks source link

Build failure if both package and install phases specified #324

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Generate a new project with android-quickstart archetype from 
http://stand.spree.de/wiki_details_maven_archetypes
2. Build with mvn clean package install

What is the expected output?

[INFO] --- maven-install-plugin:2.4:install (default-install) @ foo ---
[INFO] Installing /Users/tul/work/scratch/foo/target/foo-1.0-SNAPSHOT.apk to 
/Users/tul/.m2/repository/test/foo/1.0-SNAPSHOT/foo-1.0-SNAPSHOT.apk
[INFO] Installing /Users/tul/work/scratch/foo/pom.xml to 
/Users/tul/.m2/repository/test/foo/1.0-SNAPSHOT/foo-1.0-SNAPSHOT.pom
[INFO] Installing /Users/tul/work/scratch/foo/target/foo-1.0-SNAPSHOT.jar to 
/Users/tul/.m2/repository/test/foo/1.0-SNAPSHOT/foo-1.0-SNAPSHOT.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ----------------------

What do you see instead?

[INFO] --- android-maven-plugin:3.1.1:dex (default-dex) @ foo ---
[INFO] 
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java 
[-Xmx1024M, -jar, /Users/tul/adt-bundle-mac/sdk/platform-tools/lib/dx.jar, 
--dex, --output=/Users/tul/work/scratch/foo/target/classes.dex, 
/Users/tul/work/scratch/foo/target/classes, 
/Users/tul/work/scratch/foo/target/foo-1.0-SNAPSHOT.jar]
[INFO] 
[INFO] UNEXPECTED TOP-LEVEL EXCEPTION:
[INFO] java.lang.IllegalArgumentException: already added: 
Ltest/HelloAndroidActivity;
[INFO]  at 
com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:123)
[INFO]  at com.android.dx.dex.file.DexFile.add(DexFile.java:163)
[INFO]  at com.android.dx.command.dexer.Main.processClass(Main.java:490)
[INFO]  at com.android.dx.command.dexer.Main.processFileBytes(Main.java:459)
[INFO]  at com.android.dx.command.dexer.Main.access$400(Main.java:67)
[INFO]  at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:398)
[INFO]  at 
com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:245
)
[INFO]  at 
com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:131)
[INFO]  at 
com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:109)
[INFO]  at com.android.dx.command.dexer.Main.processOne(Main.java:422)
[INFO]  at com.android.dx.command.dexer.Main.processAllFiles(Main.java:333)
[INFO]  at com.android.dx.command.dexer.Main.run(Main.java:209)
[INFO]  at com.android.dx.command.dexer.Main.main(Main.java:174)
[INFO]  at com.android.dx.command.Main.main(Main.java:91)
[INFO] 1 error; aborting
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------

What version of maven-android-plugin are you using?

3.1.1

What are the complete output lines of "mvn -version" on your machine?

[14:53:39][tul@p020047][~/work/scratch/foo]% mvn -version
Apache Maven 3.0.4 (r1232337; 2012-01-17 10:44:56+0200)
Maven home: /Users/tul/javapackages/apache-maven-3.0.4
Java version: 1.6.0_37, vendor: Apple Inc.
Java home: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
Default locale: en_GB, platform encoding: MacRoman
OS name: "mac os x", version: "10.7.4", arch: "x86_64", family: "mac"

Please provide any additional information below.

It appears that when building classes.dex for the second time, both 
target/classes and target/foo-1.0-SNAPSHOT.jar are included as sources of 
classes, and they both obviously contain the same classes.

Original issue reported on code.google.com by tlaurino...@gmail.com on 23 Nov 2012 at 12:57

GoogleCodeExporter commented 9 years ago
The plugin should be smart enough to work for incremental builds... alas .. it 
is not. 

Original comment by mosa...@gmail.com on 7 Dec 2012 at 5:49

GoogleCodeExporter commented 9 years ago
We are no longer using the issue tracking system on Google Code. Please refile 
this issue on https://github.com/jayway/maven-android-plugin/issues if you 
still have this problem with the latest release of the Android Maven Plugin

Original comment by mosa...@gmail.com on 19 May 2014 at 4:19