Getting Warnings With Proguard (With External Libraries)

后端 未结 2 640
春和景丽
春和景丽 2020-12-08 06:18

I have enabled Proguard, and i\'m trying to build the APK, and i\'m getting a lot of warnings and don\'t know how to solve them .

I\'m using Retrofit, Jsoup and othe

2条回答
  •  鱼传尺愫
    2020-12-08 07:11

    When you use ProGuard you have to always resolve all warnings.

    These warnings tell you that the libraries reference some code and there are no sources for that. That might and might not be ok. It depends if the problematic code ever get called.

    In this case warnings for Okio and Retrofit2 can be ignored. Package java.nio.* isn't available on Android and will be never called. You can safely ignore those warnings. Also Java 8 classes won't be used.

    Add this to your ProGuard configuration, it should fix your problem:

    -dontwarn okio.**
    -dontwarn retrofit2.Platform$Java8
    

提交回复
热议问题