Duplicate files at the same path inside the APK, when adding jar

Showing 1-13 of 13 messages
Duplicate files at the same path inside the APK, when adding jar poeschel 3/29/11 9:33 AM
Hello!

I try to build the i-jetty webserver using maven-android-plugin.
I created a set of pom.xml files for this and I got the above error
building it. I first thought, that the error is because of some apklibs
contain the same references. So I copied all the sourcecode together in
one src dir and modified the relevant pom.xml but still get the same error.
I don't know which files are duplicate. I tried with 2.9.0-beta-1,
2.9.0-beta-2 and even built an 2.9.0-SNAPSHOT but nothing works. What
can I do to find my mistake ? Can I do something to help debugging ?

Thanks,
Lars


Re: [maven-android-developers] Duplicate files at the same path inside the APK, when adding jar Manfred Moser (simpligility) 3/29/11 9:10 AM
Wanna share the pom files in github or somewhere so we can have a look?

> --
> You received this message because you are subscribed to the Google Groups
> "Maven Android Developers" group.
> To post to this group, send email to
> maven-androi...@googlegroups.com.
> To unsubscribe from this group, send email to
> maven-android-developers+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/maven-android-developers?hl=en.
>
>

Re: Duplicate files at the same path inside the APK, when adding jar poeschel 3/29/11 11:52 AM

On 29 Mrz., 18:10, "Manfred Moser" <manf...@mosabuam.com> wrote:
> Wanna share the pom files in github or somewhere so we can have a look?

I already attached the pom.xml to the first post for the case that
i-jetty-server and i-jetty-ui sources are mixed to one single directory.

Here now comes the case for the original i-jetty directory structure.
This archive contains the needed poms and resources for i-jetty-server.
Simply extract in current i-jetty-SNAPSHOT.

Lars

Re: [maven-android-developers] Re: Duplicate files at the same path inside the APK, when adding jar poeschel 3/30/11 5:45 AM

I digged a bit deeper and found one problem:
All of the org.eclipse.jetty.jetty-*.jar s included from i-jetty contain
a file about.html containing the license. It seems that android's
ApkBuilder.java can not handle this. It thinks that files are duplicate.
Has someone an idea how to handle that issue best ?

Thanks, Lars

Re: [maven-android-developers] Re: Duplicate files at the same path inside the APK, when adding jar Manfred Moser (simpligility) 3/30/11 9:37 AM
--
Manfred Moser
http://www.mosabuam.com
skype mosabua, twitter.com/mosabua
http://www.linkedin.com/in/manfredmoser

Not sure.. worst case you can patch the plugin code and add a new
option that allows to exclude files of certain name patterns from the
exploded dependencies..

Not even sure if that is not already there .. check out the plugin
options.

manfred

Re: [maven-android-developers] Re: Duplicate files at the same path inside the APK, when adding jar joakime 3/30/11 1:56 PM
I"m on the hook to migrate the i-jetty build when I get time. (but not likely until mid/end of April.

Busy,
- Joakim

--
You received this message because you are subscribed to the Google Groups "Maven Android Developers" group.
To post to this group, send email to maven-androi...@googlegroups.com.
To unsubscribe from this group, send email to maven-android-developers+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/maven-android-developers?hl=en.


Re: [maven-android-developers] Re: Duplicate files at the same path inside the APK, when adding jar poeschel 3/31/11 3:32 AM
Am 30.03.2011 18:37, schrieb Manfred Moser:
> Not sure.. worst case you can patch the plugin code and add a new
> option that allows to exclude files of certain name patterns from the
> exploded dependencies.. Not even sure if that is not already there ..
> check out the plugin options.

I found no option that does that - at least not in the maven-android-plugin.
Doing this would be very difficult. I attached a stacktrace to
illustrate that.

[ERROR] Cannot add resources from jar
com.android.sdklib.build.DuplicateFileException: Duplicate files at the
same path inside the APK
        at
com.android.sdklib.build.ApkBuilder$JavaAndNativeResourceFilter.checkEntry(ApkBuilder.java:121)
        at
com.android.sdklib.internal.build.SignedJarBuilder.writeZip(SignedJarBuilder.java:225)
        at
com.android.sdklib.build.ApkBuilder.addResourcesFromJar(ApkBuilder.java:556)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:616)
        at
com.jayway.maven.plugins.android.phase09package.ApkBuilder.addResourcesFromJar(ApkBuilder.java:266)
        at
com.jayway.maven.plugins.android.phase09package.ApkMojo.doAPKWithAPKBuilder(ApkMojo.java:307)
        at
com.jayway.maven.plugins.android.phase09package.ApkMojo.createApkFile(ApkMojo.java:196)
        at
com.jayway.maven.plugins.android.phase09package.ApkMojo.execute(ApkMojo.java:169)
        at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
        at
org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:616)
        at
org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
        at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
        at
org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
        at org.codehaus.classworlds.Launcher.main(Launcher.java:375)


The last step that is controled by the maven-android-plugin is

com.jayway.maven.plugins.android.phase09package.ApkBuilder.addResourcesFromJar(ApkBuilder.java:266)

Here a whole jar file is handed over to google's SDK Tools, there the
depackaging takes place. The relevant class is:
com/android/sdklib/build/ApkBuilder.java. There some checks take place
(for duplicate files for example) and there are already some exceptions
from this (for example META-INF directory or .cvsignore files and so
on). Here would be the best place to handle this issue. But I think I
never get google to exclude "about.html" in their SDK.
The other, dirty way would be to de-jar every jar in
maven-andriod-plugin, look for about.html, exclude it and re-jar it and
then hand it over to google's ApkBuilder. Would a patch that does this
have a chance to get included ?
What do you think would be the best way ?
As a workaround I remove the about.html's from every relevant jar in my
local maven repository by hand at the moment.

Regards,
Lars

Re: [maven-android-developers] Re: Duplicate files at the same path inside the APK, when adding jar poeschel 3/31/11 6:18 AM

Heureka!

Finally I found it! There is indeed one option, which does what I need
in the maven-android-plugin.
<extractDuplicates>true</extractDuplicates>
does what I need.

Thank you!

Re: [maven-android-developers] Re: Duplicate files at the same path inside the APK, when adding jar Manfred Moser (simpligility) 3/31/11 9:03 AM
> Am 31.03.2011 12:32, schrieb Lars Poeschel:
>> Am 30.03.2011 18:37, schrieb Manfred Moser:
..

> Heureka!
>
> Finally I found it! There is indeed one option, which does what I need
> in the maven-android-plugin.
> <extractDuplicates>true</extractDuplicates>
> does what I need.
>
> Thank you!


Ha.. sweet. I thought I saw that problem and a solution for it before..

Re: Duplicate files at the same path inside the APK, when adding jar Eric Turley 4/17/13 12:58 PM
No - I never got it working.
I abandoned this path for a completely different means which is no longer applicable to this thread.
:(

On Wednesday, April 17, 2013 10:49:35 AM UTC-5, Muhi Masoud wrote:
Eric Turley did you ever get this working I have the same problem.
Thanks

On Tuesday, March 29, 2011 12:33:07 PM UTC-4, poeschel wrote:
Hello!

I try to build the i-jetty webserver using maven-android-plugin.
I created a set of pom.xml files for this and I got the above error
building it. I first thought, that the error is because of some apklibs
contain the same references. So I copied all the sourcecode together in
one src dir and modified the relevant pom.xml but still get the same error.
I don't know which files are duplicate. I tried with 2.9.0-beta-1,
2.9.0-beta-2 and even built an 2.9.0-SNAPSHOT but nothing works. What
can I do to find my mistake ? Can I do something to help debugging ?

Thanks,
Lars


Re: Duplicate files at the same path inside the APK, when adding jar Matt Wolfe 4/23/13 12:18 PM
All the sudden I'm getting this problem as well.
I have a project like so
Project A depends on Project B, Project B depends on Project C.

B and C  both have NDK libs but A does not have any (but does use C's ndk libs).

This worked up until recently. Weird that it didn't stop working at the same time as I upgraded to 3.5.3. It took several days and a bunch of builds before the problem came up. I think eclipse must have cleared out something.

I noticed that I used to use <clearNativeArtifacts>true</clearNativeArtifacts>
but that caused my build to fail saying that the so was missing (at build time). Then I set that to false and now the build works up until the last step when we get the duplicate error.

Any suggestions?
Re: Duplicate files at the same path inside the APK, when adding jar Jianing Zhang 2/25/14 4:42 PM
Hey guys,

I ran into the same problem, tried with <extractDuplicates>true</extractDuplicates> , didn't work out. Did any of you guys figure out how to solve this issue? 

Any comments? Thanks!
Re: [maven-android-developers] Re: Duplicate files at the same path inside the APK, when adding jar hanguang 2/25/14 8:54 PM
you might add some resource files multiple times. double check maven-resource-plugin outputs to see if some resource files got copied more than once.


--
You received this message because you are subscribed to the Google Groups "Maven Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to maven-android-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.