如何建立亚马逊IAP proguard的? [英] How to set up proguard for amazon iap?

查看:192
本文介绍了如何建立亚马逊IAP proguard的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图建立与亚马逊IAP集成了基本的ProGuard。然而,当我试图导出我的apk,我得到了以下错误:

I'm trying to set up a basic proguard with amazon iap integrated. However when I'm trying to export my apk, I got the following errors:

[2012-06-17 10:59:44 - sc] Proguard returned with error code 1. See console
[2012-06-17 10:59:44 - sc] Unexpected error while performing partial evaluation:
[2012-06-17 10:59:44 - sc]   Class       = [com/amazon/inapp/purchasing/KiwiResponseHandler$PurchaseResponseHandlerRunnable]
[2012-06-17 10:59:44 - sc]   Method      = [run()V]
[2012-06-17 10:59:44 - sc]   Exception   = [java.lang.IllegalArgumentException] (Can't find common super class of [java/lang/String] (with 4 known super classes) and [com/amazon/inapp/purchasing/KiwiPurchaseResponseCommandTask] (with 1 known super classes))
[2012-06-17 10:59:44 - sc] java.lang.IllegalArgumentException: Can't find common super class of [java/lang/String] (with 4 known super classes) and [com/amazon/inapp/purchasing/KiwiPurchaseResponseCommandTask] (with 1 known super classes)
[2012-06-17 10:59:44 - sc]  at proguard.evaluation.value.ReferenceValue.generalize(ReferenceValue.java:344)
[2012-06-17 10:59:44 - sc]  at proguard.evaluation.value.IdentifiedReferenceValue.generalize(IdentifiedReferenceValue.java:65)
[2012-06-17 10:59:44 - sc]  at proguard.evaluation.value.ReferenceValue.generalize(ReferenceValue.java:481)
...

我有默认的proguard的配置文件,我已经添加了:

I have the default proguard configuration file, and I have already added the:

 -dontwarn com.amazon.**
 -keep class com.amazon.** {*;}
 -keepattributes *Annotation*

行到它。任何建议有什么地方错了?

lines to it. Any suggestion what's went wrong?

推荐答案

每的 Amazon的SDK文档,这里有你行应包括:

Per Amazon's SDK Docs, here are the lines you should include:

preventing应用内购买API的混淆

在结合了应用内购买API到您的库中,你将需要指定类保持,而不是混淆。任意位置添加以下行你proguard.cfg文件。

When incorporating the In-App Purchasing API into your library, you will need to specify classes to 'keep' and not obfuscate. Add the following lines anywhere in your proguard.cfg file.

-dontwarn com.amazon.**
-keep class com.amazon.** {*;}
-keepattributes *Annotation*

此外,您还需要跳过Proguard的的优化步骤。

In addition, you will also need to skip Proguard's optimization step.

-dontoptimize

请注意:一定要删除任何其他标​​志处理的优化,或者任何标志,可能与上述设置冲突

Note: Make sure to remove any other flags dealing with optimization, or any flag that may conflict with the above settings.

这篇关于如何建立亚马逊IAP proguard的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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