我使用解析1.5.1构建,当progurad只添加一行时没有问题。
-keep class com.parse.** { *; }
我将解析升级到1.9.4,但是解析不起作用。 我引用其他主题,我在下面添加的行仍然无效。 我可以忽略解析警告,但它无法解决任何问题。
-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.
答案 0 :(得分:3)
我自己有这个问题所以我请求解析帮助。他们提出了以下proguard文件:
# 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.**