I have got JMock working Android however I had to repackage the hamcrest libraries.
The error you get in Android ADK is:- Error generating final archive: duplicate entry: LICENSE.txt
Work around: unzip hamcrest-core-1.1.jar unzip hamcrest-library-1.1.jar in the same directory.
This the second unzip overwrites MANIFEST.MF and LICENCE.TXT.
zip ../hamcrest-all-1.1.jar
Comment #1
Posted on Jan 22, 2011 by Swift LionHey, I got a similar problem, but not with JMock though.
I tried to use hamcrest-core and hamcrest-library on Android, but the Android project failed to build, same error message as the above.
The solution is to either remove the LICENCE.txt files, or put them inside each of the META-INF folder in the jar.
Keep up the good work guys, hamcrest is cool!
Comment #2
Posted on Feb 18, 2011 by Quick GiraffeCould the next maven release of Hamcrest include this alteration to the location of the LICENCE.txt file? I'm getting the clash problem with both version 1.2.1 & 1.3RC2 - this is trying to use 'hamcrest-library', which of course includes hamcrest-core as a dependency - all I want are some nice marchers beyond the core ones!
Comment #3
Posted on Feb 21, 2011 by Quick GiraffeSuper-awesomely, it looks like the next version of the maven-android-plugin (v2.9.0, as yet unreleased) will have duplicate-detection-and-removal, allowing builds to proceed even with the collisions in hamcrest-core & hamcrest-library:
http://code.google.com/p/maven-android-plugin/issues/detail?id=123
Comment #4
Posted on May 12, 2012 by Massive Hippotagging
Comment #5
Posted on Jul 29, 2012 by Massive HippoI've just moved the LICENSE.txt file into the META-INF directory of the hamcrest jars. See commit https://github.com/hamcrest/JavaHamcrest/commit/9e2a15913122e216752280c0f89f8215aaa23b43
This will not take effect until the next release.
Status: Fixed
Labels:
Java