Matthias247 / jawampa

Web Application Messaging Protocol (WAMP v2) support for Java
Apache License 2.0
148 stars 57 forks source link

DuplicateFileException: Duplicate files copied in APK META-INF/INDEX.LIST #94

Closed pykaso closed 7 years ago

pykaso commented 8 years ago

Hi, I added dependency to jawampa to my Android project. Now I'm getting this error.

Dep: compile 'ws.wamp.jawampa:jawampa-netty:0.4.2'

Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.

com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK META-INF/INDEX.LIST File1: /Users/lgergel/.gradle/caches/modules-2/files-2.1/io.netty/netty-buffer/4.0.24.Final/86b0544a2ad9c647894dd460abcd8806da08f5d4/netty-buffer-4.0.24.Final.jar File2: /Users/lgergel/.gradle/caches/modules-2/files-2.1/io.netty/netty-transport/4.0.24.Final/95689eb79181ecd96592b0217fe4af0aca143d5/netty-transport-4.0.24.Final.jar File3: /Users/lgergel/.gradle/caches/modules-2/files-2.1/io.netty/netty-codec-http/4.0.24.Final/aa59de3ada353518026f869bb89b71064f65911e/netty-codec-http-4.0.24.Final.jar File4: /Users/lgergel/.gradle/caches/modules-2/files-2.1/io.netty/netty-handler/4.0.24.Final/a5d1c44bbfab44cb45987ebf31904c32250e2e80/netty-handler-4.0.24.Final.jar File5: /Users/lgergel/.gradle/caches/modules-2/files-2.1/io.netty/netty-codec/4.0.24.Final/862a801978d25197ae44292337aabf26c6703b9e/netty-codec-4.0.24.Final.jar File6: /Users/lgergel/.gradle/caches/modules-2/files-2.1/io.netty/netty-common/4.0.24.Final/60c06ba48277374ac1e75ad8edabd40d0d91586c/netty-common-4.0.24.Final.jar

Alebat commented 7 years ago

Same error

Alebat commented 7 years ago

I solved my problem: I import jawampa in an android library, as the error comes from the APK generation I added the following options in the build.gradle file of the main application, not in the library's:

android{
    packagingOptions {
        pickFirst 'META-INF/INDEX.LIST'
        pickFirst 'META-INF/LICENSE'
        pickFirst 'META-INF/io.netty.versions.properties'
    }
}

But now it does not find classes (java.lang.NoClassDefFoundError)

zigeH commented 7 years ago

thanks! I spent 3hours on this problem!

Matthias247 commented 7 years ago

I'm closing this one, since it seems the issue is a dependency conflict within the application that can only only be resolved by the app developer. If there's a specific improvement for jawampa that needs to be made feel free to open a new issue.