Search code examples
androidlibrariesapkgsonduplication

Does anyone know how to get rid of this error while trying to use GSON libraries?


I am using code (not written by me) with dependencies on GSON libraries. I have downloaded the libraries and when I try to include them in the project I get a duplication error. Specifically:

Error generating final archive: Found duplicate file for APK: assembly-descriptor.xml

Here's a screenshot of the error:

I don't have a lot of experience with using external libraries. Can anyone help me out?

Thanks in advance.


Solution

  • I had the same problem, the solution found out to be rather simple though. Just choose one of the libraries - either gson-1.6-sources or gson-1.6 to be added to your path and bravely delete another one from there.

    It caused me quite lot of trouble, not only with error, you've mentioned but also with NoClassDefFoundError for Gson class within my Activity code.

    P.S. I would appreciate any clarification, why this duplication error actually happens:).