3

有谁知道如何在钛调试模式下正确测试应用购买中的实时 android?

以前,我在 Titanium Studio 调试时能够成功测试实时应用内购买并创建真实交易。那是因为以前,我使用开发 .apk 错误地创建了我的 Google Play 商店列表:http: //developer.appcelerator.com/question/123704/what-keystore-does-titanium-studio-use-to-构建-android-app-during-development

因此,Google Play 将我的 dev_keystore 与我的应用内购买代码相关联。

但是,当我尝试使用生成的密钥对/证书按照以下方式构建和上传我的生产版本时:wiki.appcelerator.org/display/guides/Distributing+Android+apps

然后,Google Play 商店(正确地)拒绝了我的生产候选人,抱怨我的 APK 已使用与原始上传中使用的证书不同的证书进行签名:

You uploaded an APK that is signed with a different certificate to your previous APKs. 
You must use the same certificate. Your existing APKs are signed with the certificate(s) 
with fingerprint(s): [ SHA1: ...:9D:47:9F ] and the certificate(s) used to sign the APK 
you uploaded have fingerprint(s): [ SHA1: ...:5D:E2:4E ]

因此,我不得不删除我的 google play 商店列表,并使用上面引用的 appcelerator 指南所述的签名 APK 从头开始​​重新创建它。

现在,这导致我的应用内购买与签名的 APK 相关联,这意味着现在当我测试应用的开发版本并尝试进行应用内购买时,我会收到以下信息:

This version of the application is not configured for billing through Google Play

这不是时间问题(我已经等了 24 小时),正如以下建议的那样:stackoverflow.com/questions/11068686/this-version-of-the-application-is-not-configured-for-billing-through-google-pla

这是因为我的开发版本中的 dev_keystore 与与应用内购买代码关联的证书不匹配。

我想如果Titanium studio允许我在调试时指定我的应用程序证书证书,我可能能够解决这个问题:http: //jira.appcelerator.org/browse/TISTUD-1214

在此期间,调试购买的测试解决方法是,我创建了一个额外且单独的“测试”重复 google play 应用程序,其中包含相同的应用内购买,并将其与我的开发 .apk(而不是我签名的 apk)相关联。在测试期间,我只需要更改:

require('ti.inappbilling').setPublicKey(...)

指向测试项目而不是真实项目。然后,当我对付款感到满意时,我将使用真正的密钥进行构建。

这是一个非常不合标准的解决方法,我希望有人有更好的做事方式。

4

1 回答 1

1

TISTUD-3669添加了指定用于非生产构建的密钥库的功能。使用它,您将不需要您想出的解决方法。

于 2013-12-16T20:08:03.990 回答