Gson Error

Arashjit

New Member
Hello Max,
We are trying to integrate the demo app in our project to test the functionality. We have included the .aar file in the project and build is successful. However on running the application there is error which is :-
Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
> com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/gson/annotations/Expose.class

We are using retrofit library for network calls that uses the gson library, it's gradle dependency is :-
compile 'com.squareup.retrofit2:converter-gson:2.1.0'
I am attaching the build.gradle for your reference.

We have tried these 2 options but it does not work :-
a)
compile project(':wcs-android-sdk-1.0.1.29'){
exclude group:'com.google.code.gson', module:'gson'}
b)
compile project(':wcs-android-sdk-1.0.1.29'){
transitive = true;
exclude module: 'gson'}
 

Attachments

Max

Administrator
Staff member
You can do that with mc on Linux
1. Install midnight commander, zip, unzip
Code:
yum install mc zip unzip
2. Run mc
Code:
mc
and enter into the archive and remove needed files
 

hiren

New Member
i have same error..so followed above steps..but it gives me java-webscoket duplicate entry error..while i am enable shrinkResource and
minifyEnabled..to true...after remove java-websocket lib from aar file...flashphoner player not working,,,
 

Mukesh Singh

New Member
1. Download 7zip archive softwar and the open flashphoner library with it. Go to libs folder and then select library that you want to delete and click delete icon on 7zip .
After it you add this library in project.
https://www.7-zip.org/download.html

Other way
2. try to exclude that module from library using exclude tag
 
Last edited:
Top