In-app Billing Error

只愿长相守 提交于 2019-12-05 00:55:41

问题


My [UNMANAGED] in-app purchase won't work, Before it works perfectly which I can purchase successfully using Test Accounts. But it suddenly won't work, as I remember what I did to Merchant Account is only add more 2-4 Test Accounts. Then after adding, my in-app purchase won't work. So I updated the public key and upload an Apk as draft. But still won't work.

When the app is in google play page I received a LogCat error:

11-20 17:00:18.840: E/Finsky(2182): [187] FileBasedKeyValueStore.delete: Attempt to delete 'paramsqE9ZgJf5Z6GeZu1wwGPosw' failed!

Then when I click the Buy & Accept button I only received these LogCats:

11-20 17:00:39.520: I/BillingService(2408): handleCommand() action: com.android.vending.billing.RESPONSE_CODE
11-20 17:00:39.520: I/LoginActivity(2408): purchase was successfully sent to server

I am expecting for Security Verification's Logs and onPurchaseStateChange(...) to called, but I don't get any onPurchaseStateChange.

Please help me with this problem.

Also when I test android.test.purchased the reserved product IDs for testing static in-app billing responses but still got the same Logs/Responses.

UPDATES-----------------------

I removed some Test Accounts but leaving only two (as suggested by @Tigger below). And now I'm not getting any error from Google page. But still the onPurchaseStateChange() function didn't fire. And I didn't receive any Logs from Security.java.

The last Log I received is: "purchase was successfully sent to server"


回答1:


This may not be a correct answer, but from my personal testing and notes taken from all over the place:

  • The draft app you upload must have the same "version code" and "version name" as any that you are testing.
  • If you upload a new version (with a new "version code" or "version name") it can take 4 to 24 hours before the new version will work correctly for testing.
  • Double check that the account used on the device is in fact one of the test accounts.
  • Your draft APK that you upload must be signed with the same key that will be used on the final version.
  • For testing on a device (the emulator will not work with the Play Store), so long as the "version code" and "version name" match the the draft APK in the Play Store, testing and debugging works.

Hope that helps a little.

Edit: Some changes to clarify a few points.




回答2:


I had this error, but my mistake was that the upload behaviour has changed.

It used to be that you uploaded an APK as a draft to the production tab of the play store dashboard. Now, you have to upload to the Alpha tab of the dashboard, and publish your app (http://developer.android.com/google/play/billing/billing_testing.html#draft_apps).

Don't worry if you're still in pre-production on your app; if you have no APKs in the production tab when you publish, nothing will appear in the Play Store.



来源:https://stackoverflow.com/questions/13470338/in-app-billing-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!