Proguard tells me 'Please correct the above warnings first.'. How to address references of external jars?

前端 未结 2 1761
天命终不由人
天命终不由人 2020-12-17 10:06

How can I address the warnings?

Log says

 [proguard] Note: duplicate definition of library class...
 ...
 [proguard] Note: there we         


        
相关标签:
2条回答
  • 2020-12-17 10:54

    You have to reassure ProGuard that some suspicious constructs in the input jars are ok.

    Your program code contains copies or better versions of Android runtime classes in the package org.xmlpull.v1. If that's ok:

    -dontwarn org.xmlpull.v1.**
    -dontnote org.xmlpull.v1.**
    

    Your program code contains copies of Android runtime classes in org.apache.http. If that's ok:

    -dontnote org.apache.http.**
    

    Your program code in the package examples refers to AWT, which doesn't exist in Android. If that's ok:

    -dontwarn java.awt.**
    

    Your PostgreSQL driver refers to many javax classes that don't exist in Android. If that's ok:

    -dontwarn org.postgresql.**
    

    And so on...

    Cfr. ProGuard manual > Troubleshooting

    Finally, your configuration specifies -keep public class !testAppH23.** { *;}, which keeps all public classes except those in testAppH23, and their public/protected/private class members, from being shrunk/optimized/obfuscated. This may cause some (harmless) notes about descriptor classes. For consistency, you may want to remove "public" for the classes, or add "public protected" for the class members.

    0 讨论(0)
  • 2020-12-17 10:57

    You can try to resolve it:

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