问题
I am integrating in-app billing in my application. But, I'm facing issues in testing my app. Every time, I try to purchase an in app item. A wired message comes up The item you were attempting purchase could not be found. On Logcat, following appeared up:
09-10 14:45:02.437: E/IabHelper(12617): Launching buy intent for premium. Request code: 10001
09-10 14:45:02.523: E/Finsky(11260): [8464] FileBasedKeyValueStore.delete: Attempt to delete 'paramspXaplU_vTGhfGqvnmPPddQ' failed!
09-10 14:45:04.000: E/Volley(11260): [8448] BasicNetwork.performRequest: Unexpected response code 500 for https://android.clients.google.com/fdfe/preparePurchase
After I click OK, logcat showed the following:
09-10 14:45:05.546: E/TrivialDrive(12617): onActivityResult(10001,0,Intent { (has extras) }
09-10 14:45:05.546: E/IabHelper(12617): Ending async operation: launchPurchaseFlow
09-10 14:45:05.546: E/IabHelper(12617): Purchase canceled - Response: 2:Unknown
09-10 14:45:05.546: E/TrivialDrive(12617): Purchase finished: IabResult: User canceled. (response: -1005:User cancelled), purchase: null
09-10 14:45:05.546: E/TrivialDrive(12617): **** TrivialDrive Error: Error purchasing: IabResult: User canceled. (response: -1005:User cancelled)
I had checked following things numerous times:
- I am registered with same google account on my testing device that I had set as test account.
- All In-app products I created are active.
- I uploaded the apk in alpha channel, it is mentioned that draft mode is no longer supported.
- I had verified the license key for my application from the developer console.
- Someone suggested to reboot my device once. I did that also.
- I had installed the same apk on my device that I had uploaded to Google Play. Both are signed with same certificate.
- It is mentioned that, one should wait for atleast 2-3 hours in order to get apk recognized. For me, its been more than 15 hours.
- Also, my test account is different from merchant account.
I modified the Google's sample as well as created my own sample. In both cases, I am facing same problem.
Update: I am testing IAB from my client's developer account. I noticed that her merchant wallet account is still not verified. I am not sure, if this is the root cause of this issue.
回答1:
The cause of this problem was pretty dumb, after uploading app to alpha channel, it needs to published. I was not publishing it, so it remained in draft mode. After I published the app, it worked within an hour.
回答2:
It might help someone: Make sure, your test app has no higher version code defined that the one you have uploaded in play store.
来源:https://stackoverflow.com/questions/25762342/android-issue-with-in-app-billing