nttcom / SkyWay-Android-SDK

[Deprecated]
3 stars 3 forks source link

Conflict Gson with Retrofit 2 #9

Closed kainjinez closed 7 years ago

kainjinez commented 7 years ago

I found you used Gson 2.5 for SkyWay. But it was conflict with Retrofit 2 compile 'com.squareup.retrofit2:converter-gson:2.1.0' This is my error log while compiling 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 How do I solve (or exclude) this?

yusuke84 commented 7 years ago

@kainjinez A similar inquiry was in the past. Sorry for only Japanese. https://groups.google.com/forum/#!msg/skywayjs/FONoQgVLP04/NdWYtsOLDAAJ

Proposed 1

This error could be avoided by unpacking SkyWay.aar, deleting "libs / gson - 2.5.jar", and compressing it again.

Proposed 2

// build.gradle

configurations {
    all*.exclude module: 'gson'
}
kainjinez commented 7 years ago

Thanks. I tried same as your proposed 1 yesterday, and It looks good for now. Thanks

tuancoltech commented 7 years ago

Hi kainjinez,

I have the same issue like you. Could you tell me how exactly did you compress the lib folder after deleting the gson jar file? I'm using Windows.

Thank you

kainjinez commented 7 years ago

@tuancoltech Please open aar file with WinRAR, then delete gson-2.5.jar in lbs folder. You don't need to extract it before delete, because WinRAR will extract and compress it automatically.

tuancoltech commented 7 years ago

@kainjinez Thank you very much, it works like a charm.