Android Proguard Duplicate Definition

回眸只為那壹抹淺笑 提交于 2019-11-28 13:25:58

Fixed this by moving the 3rd party libraries to another directory, in my case 'lib'. Then added

-injars lib/jmdns.jar 

to the proguard.cfg file.

If the 3rd party lbs are included in the 'libs' folder, then they are processed twice.

In current progaurd version there is no need to specify injars. It is handled by default. This could be due to the following reasons-

1) duplicate jar files in some referenced libraries.

Solution - Removed it from the application and let it be reference library

2) Could be due to different gradle versions between your application gradle file and referenced library gradle file. Make it same.

Solution - Edit the gradle file to one of the referenced library's/Project's gradle file. See the classpath is same for both projects.

dependencies { classpath 'com.android.tools.build:gradle:1.3.0' }

I had both these problems, rectified it and it worked.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!