我使用parse 1.5.1构建,当程序只添加一行时没有问题。
-keep class com.parse.** { *; }
我将parse升级到1.9.4,但是parse不起作用。我参考了其他主题,我在下面添加了几行仍然不起作用。我可以忽略解析警告,但它不能解决任何问题。
-keepattributes Annotation,SourceFile,LineNumberTable
-keepattributes Signature
-keep interface com.parse.** { *; }
-keep class com.parse.** { *; }
-keep class com.squareup.** { *; }
-keep interface com.squareup.** { *; }
当我使用Parse 1.9.4构建发布版本时,我得到了错误。
[2015-08-13 10:49:29 - wargame] Proguard returned with error code 1. See console
[2015-08-13 10:49:29 - wargame] Warning: com.parse.ParseOkHttpClient$CountingOkHttpRequestBody: can't find superclass or interface com.squareup.okhttp.RequestBody
[2015-08-13 10:49:29 - wargame] Warning: com.parse.ParseOkHttpClient: can't find referenced class com.squareup.okhttp.OkHttpClient
[2015-08-13 10:49:29 - wargame] Warning: com.parse.ParseOkHttpClient: can't find referenced class com.squareup.okhttp.Response
[2015-08-13 10:49:29 - wargame] Warning: com.parse.ParseOkHttpClient: can't find referenced class com.squareup.okhttp.ResponseBody
[2015-08-13 10:49:29 - wargame] Warning: com.parse.ParseOkHttpClient: can't find referenced class com.squareup.okhttp.Request$Builder
[2015-08-13 10:49:29 - wargame] Warning: com.parse.ParseOkHttpClient$1: can't find referenced class com.squareup.okhttp.Call
[2015-08-13 10:49:29 - wargame] Warning: com.parse.ParseOkHttpClient$CountingOkHttpRequestBody: can't find referenced class com.squareup.okhttp.RequestBody
[2015-08-13 10:49:29 - wargame] Warning: com.parse.ParseOkHttpClient$CountingOkHttpRequestBody: can't find referenced class okio.BufferedSink
[2015-08-13 10:49:29 - wargame] You should check if you need to specify additional program jars.
[2015-08-13 10:49:29 - wargame] Warning: there were 72 unresolved references to classes or interfaces.
[2015-08-13 10:49:29 - wargame] You may need to specify additional library jars (using '-libraryjars').
[2015-08-13 10:49:29 - wargame] Error: Please correct the above warnings first.
我自己有这些问题,所以我向parse寻求帮助。他们提出了以下保护文件:
# Keep source file names, line numbers, and Parse class/method names for easier debugging
-keepattributes SourceFile,LineNumberTable
-keepnames class com.parse.** { *; }
# Required for Parse
-keepattributes *Annotation*
-keepattributes Signature
-dontwarn com.squareup.**
-dontwarn okio.**