Android – Fix for Duplicate files copied in APK

If you are an android developer you may already familiar with this issue.

Usually you’re getting this for some text files or license files like  META-INF/notice.txt ,  META-INF/license.txt ,  META-INF/ASL2.0

In such scenarios we can exclude those files from APK packaging without any hesitation because we definitely know those will not affect our application functionality. We can do so using gradle  packagingOptions .

What can we do when we get like

or

or

We cannot exclude those files since they required for app functionality. So we need another way to handle such scenarios.

We can use  pickFirst in  packagingOptions to avoid duplicate file copying to APK as below.



5 thoughts on “Android – Fix for Duplicate files copied in APK

  • July 9, 2018 at 5:05 pm
    Permalink

    I am also writing to make you be aware of what a perfect discovery my friend’s princess found browsing yuor web blog. She even learned too many details, including what it’s like to have a great helping nature to make most people with no trouble know precisely various tortuous topics. You really did more than her desires. I appreciate you for providing these invaluable, trusted, explanatory and even easy thoughts on this topic to Mary.

    Reply
  • July 14, 2018 at 3:40 am
    Permalink

    I simply had to thank you so much all over again. I’m not certain what I would have taken care of in the absence of the actual recommendations shown by you on such a subject matter. It actually was a very troublesome problem for me personally, however , observing a professional fashion you solved it made me to weep over contentment. Now i’m grateful for the information and thus expect you are aware of a powerful job you were providing educating the rest using your web page. I’m certain you have never got to know all of us.

    Reply
  • July 14, 2018 at 11:50 am
    Permalink

    Hello! I know this is kinda off topic nevertheless I’d figured I’d ask. Would you be interested in trading links or maybe guest writing a blog article or vice-versa? My website covers a lot of the same subjects as yours and I think we could greatly benefit from each other. If you’re interested feel free to send me an email. I look forward to hearing from you! Superb blog by the way!

    Reply
  • July 19, 2018 at 7:25 pm
    Permalink

    I definitely wanted to jot down a small note to express gratitude to you for some of the fantastic secrets you are giving here. My prolonged internet search has at the end been honored with beneficial content to exchange with my partners. I would tell you that many of us readers actually are extremely lucky to live in a decent website with very many awesome professionals with good basics. I feel really privileged to have come across your website page and look forward to some more cool moments reading here. Thanks a lot again for all the details.

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *