Android Proguard Duplicate Definition

后端 未结 2 2003
一生所求
一生所求 2020-12-11 15:54

I\'m attempting to add a 3rd party library (JmDNS) to my Android project.

I created a folder \'libs\' under the base project directory, and dropped the jar file in

相关标签:
2条回答
  • 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.

    0 讨论(0)
  • 2020-12-11 16:57

    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.

    0 讨论(0)
提交回复
热议问题