我正在使用Parse库和许多不同的库项目开发Android应用程序。对于导出apk文件,我正在使用Pro Guard。在执行apk文件的导出时,我收到以下错误:
[2015-05-03 20:59:49 - SampleProject] Proguard returned with error code 1. See console
[2015-05-03 20:59:49 - SampleProject] Warning: com.parse.FacebookAuthenticationProvider$1: can't find superclass or interface com.facebook.android.Facebook$ServiceListener
[2015-05-03 20:59:49 - SampleProject] Warning: com.parse.FacebookAuthenticationProvider$2: can't find superclass or interface com.facebook.Session$StatusCallback
[2015-05-03 20:59:49 - SampleProject] Warning: com.parse.FacebookAuthenticationProvider$2$1: can't find superclass or interface com.facebook.Request$Callback
[2015-05-03 20:59:49 - SampleProject] Warning: org.hamcrest.generator.qdox.ant.AbstractQdoxTask: can't find superclass or interface org.apache.tools.ant.Task
[2015-05-03 20:59:49 - SampleProject] Warning: org.hamcrest.integration.EasyMock2Adapter: can't find superclass or interface org.easymock.IArgumentMatcher
[2015-05-03 20:59:49 - SampleProject] Warning: org.hamcrest.integration.JMock1Adapter: can't find superclass or interface org.jmock.core.Constraint
[2015-05-03 20:59:49 - SampleProject] Warning: com.google.common.base.Equivalence: can't find referenced class javax.annotation.Nullable
答案 0 :(得分:1)
在proguard-project.txt
添加此-dontwarn
和 - keep class
行:
-keep class com.parse.*{ *; }
-dontwarn com.parse.**
-dontwarn com.google.common.**
-dontwarn org.hamcrest.**