当我使用proguard生成发布APK时,我收到错误

时间:2016-01-21 07:30:25

标签: java proguard

如何解决此错误?

Warning:com.parse.ParseOkHttpClient: can't find referenced class com.squareup.okhttp.Headers

Warning:com.ocpsoft.pretty.time.web.jsf.PrettyTimeConverter: can't find referenced class javax.faces.context.FacesContext

Warning:Exception while processing task java.io.IOException: Please correct the above warnings first.

Error:Execution failed for task ':project1:transformClassesAndResourcesWithProguardForRelease'.<br>
 java.io.IOException: Please correct the above warnings first.

1 个答案:

答案 0 :(得分:2)

将其添加到项目中的proguard-rules.pro文件中:

-keep class com.squareup.** {*;}
-dontwarn com.squareup.**
-keep class com.ocpsoft.** {*;}
-dontwarn com.ocpsoft.**