How to fix warning 'can't find referenced class' in Android Eclipse ProGuard Rule?

折月煮酒 提交于 2019-11-29 14:20:11

You can Solve that by modifying the 'progaurd-rules.pro' which seems that you are using Progaurd for Shrinking your Code.

You must use -dontwarn But be careful before adding this to proguard file as there will not be errors at testing because Proguard had already delete some classes not being used

for case of OKiO add these lines

-dontwarn java.nio.file.*
-dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
-dontwarn okio.**

For any other library you can see this link for further proguard operations https://github.com/krschultz/android-proguard-snippets

Probably its better to add Okio rules from android-proguard-snippets:

# Okio
-keep class sun.misc.Unsafe { *; }
-dontwarn java.nio.file.*
-dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
-dontwarn okio.**
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!