[英]Android In-App Billing invalidKeySpecException wrong tag
I am implementing basic usage of android billing purchase v3 using IabHelper and I am still encountering this issue when I am testing on real device. 我正在使用IabHelper实现android billing purchase v3的基本用法,并且在实际设备上进行测试时仍然遇到此问题。 I run the first time and after successful purchase i consume the product. 我第一次运行,成功购买后就消费该产品。 Now I'am getting the error again and again. 现在,我一次又一次收到错误。
I have already checked my public key (even using different encoding) so i don't think it is the problem. 我已经检查了我的公钥(即使使用了不同的编码),所以我认为这不是问题。 I have consumed all android.test.*
products after testing static responses. 测试静态响应后,我已经消耗了所有android.test.*
产品。 I also tried to edit the verifyPurchase
method in Security.java but it seems the error occurs at this call PublicKey key = Security.generatePublicKey(base64PublicKey);
我也尝试在Security.java中编辑verifyPurchase
方法,但似乎在此调用时发生错误PublicKey key = Security.generatePublicKey(base64PublicKey);
Has somebody managed to solve definitely the issue? 有人设法解决了这个问题吗?
Here is the log for the error : 这是错误的日志:
java.lang.IllegalArgumentException: java.security.spec.InvalidKeySpecException: java.lang.RuntimeException: error:0c0890ba:ASN.1 encoding routines:asn1_check_tlen:WRONG_TAG
at com.hubsante.nutrition.utils.util.Security.generatePublicKey(Security.java:82)
at com.hubsante.nutrition.utils.util.Security.verifyPurchase(Security.java:62)
at com.hubsante.nutrition.utils.util.IabHelper.queryPurchases(IabHelper.java:972)
at com.hubsante.nutrition.utils.util.IabHelper.queryInventory(IabHelper.java:624)
at com.hubsante.nutrition.utils.util.IabHelper$2.run(IabHelper.java:698)
at java.lang.Thread.run(Thread.java:818)
也许var base64publickey的长度或格式无效
看来公钥的格式不正确,我已对其进行了更正,现在可以正常工作了。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.