Android应用内结算:购买后收到空白数据

seh*_*ugg 5 android billing in-app-purchase google-play

我正在尝试实施应用内结算.我已登录到在Market注册的测试帐户,并且我已在代码中更新了我的公钥.我可以购买其中一个测试产品ID.

但是,似乎在PURCHASE_STATE_CHANGED意图中发送了空白签名.日志显示如下:

INFO/BillingReceiver(21437): notifyId: android.test.purchased
WARN/ActivityManager(2513): Duplicate finish request for HistoryRecord{47de4b38 com.android.vending/.billing.InAppBuyPageActivity}
INFO/BillingService(21437): handleCommand() action: com.app.GET_PURCHASE_INFORMATION
DEBUG/BillingService(21437): GetPurchaseInformation
ERROR/BillingService(21437): getPurchaseInformation received RESULT_OK
DEBUG/BillingService(21437): request id: 4241021538346688898
INFO/BillingService(21437): handleCommand() action: com.android.vending.billing.RESPONSE_CODE
DEBUG/BillingService(21437): RequestPurchase: RESULT_OK
INFO/BillingService(21437): handleCommand() action: com.android.vending.billing.PURCHASE_STATE_CHANGED
INFO/Security(21437): signedData: {"nonce":-3927284292945900504,"orders":[{"notificationId":"android.test.purchased","orderId":"transactionId.android.test.purchased","packageName":"com.app","productId":"android.test.purchased","purchaseTime":1301944310410,"purchaseState":0}]}
INFO/Security(21542): signature: 
INFO/Security(21437): Purchase not verified
INFO/Security(21437): Purchase count = 0
INFO/BillingService(21437): handleCommand() action: com.android.vending.billing.RESPONSE_CODE
DEBUG/BillingService(21437): GetPurchaseInformation: RESULT_OK
Run Code Online (Sandbox Code Playgroud)

"购买未经验证"是由于代码跳过签名验证(因为它是空白的)并且抛弃了产品购买.

任何的想法?我没有在文档中看到签名可能是空白的或原因是什么.

FWIW,这只发生在我的三星Vibrant Galaxy S(2.2.1)上.它在Droid(2.2.2)上工作正常.

编辑:当我得到PURCHASE_STATE_CHANGED意图作为恢复事务操作的结果时,我在日志中得到了这个:

INFO/BillingService(24010): handleCommand() action: com.android.vending.billing.PURCHASE_STATE_CHANGED
ERROR/Security(24010): data is null
Run Code Online (Sandbox Code Playgroud)

这表明根本没有发送签名的有效负载.

编辑:在进一步测试时,似乎这发生在上传的应用程序的版本和安装的应用程序不同时.http://code.google.com/p/marketbilling/issues/detail?id=15

小智 2

我也遇到了这个问题。我增加了 apk 的 versionCode,对其进行了正确签名,但随后只从市场得到了这些空响应。

为了解决这个问题,我将新的 apk 作为草稿上传到市场,然后我得到了有效的回复。