proguard 后 parse.com 不工作 [英] parse.com not working after proguard

查看:41
本文介绍了proguard 后 parse.com 不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的应用中使用 Parse.com 功能,在调试模式下一切正常.一旦我在发布模式下生成一个签名的 apk,我就会在打开我的应用程序开始时等待有时长达 10 秒.很可能是因为 Parse.com 尝试初始化并联系其服务器,但显然没有成功.

I'm using Parse.com features in my app, everything works great on debugging mode. As soon as I generate a signed apk in release mode, I have a killing wait sometimes up to 10 seconds at the beginning of opening my app. most probably it's because of Parse.com trying to initialize and contact its servers, which apparently is not successful.

而且,我知道 parse.com 停止工作,因为不会将任何数据上传到我的帐户中.

And also, parse.com stops working I know so, since no data would be uploaded into my account.

Proguard 当然应该有问题,因为调试模式和发布模式之间的唯一区别是在我的情况下启用 proguard.

There should be a problem with Proguard of course since the only difference between debug and release mode, is enabling proguard, in my case.

我还尝试在我的 proguard 规则中使用以下代码保留 com.parse:

I have also triend to keep com.parse with following code in my proguard rules:

 #keep parse classes
-keepattributes Annotation,SourceFile,LineNumberTable
-dontwarn com.parse.**
-keep class com.parse.* { *; }
-keep class com.parse.** { *; }

任何帮助将不胜感激!

我发现在 Proguard 之后 Parse.initialize() 发生了巨大的内存泄漏......但仍然不知道为什么!当然,当 proguard 关闭时,这种内存泄漏是不存在的

I found out that a huge memory leak is happening at the Parse.initialize() after the Proguard ... still have no idea why though! Of course this memory leak is not present while proguard is off

推荐答案

如果您有 Apache http-corehttp-mime 以及 ,请尝试以下操作解析库:

Try the following if you have Apache http-core and http-mime along with Parse library:

-keep class org.apache.** { *; }
-keep class com.parse.** { *; }

-dontwarn com.parse.**
-dontwarn org.apache.**
-dontwarn com.squareup.**

这篇关于proguard 后 parse.com 不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆