0
votes

I am trying to run the TrivialDrive on a phone to test it. I have taken all the precautions i.e. Not running it on my own phone. I have checked the versions are the same. I have waited enough time for GP servers to update, etc.... Does anyone know why this is happening? Thanks.

04-20 22:26:54.860: D/dalvikvm(3960): GC_EXTERNAL_ALLOC freed 47K, 50% free 2727K/5379K, external 0K/0K, paused 22ms 04-20 22:26:54.885: D/TrivialDrive(3960): Loaded data: tank = 2 04-20 22:26:54.885: D/TrivialDrive(3960): Creating IAB helper. 04-20 22:26:54.885: D/TrivialDrive(3960): Starting setup. 04-20 22:26:54.885: D/IabHelper(3960): Starting in-app billing setup. 04-20 22:26:54.885: I/ApplicationPackageManager(3960): cscCountry is not German : XEU 04-20 22:26:54.910: D/IabHelper(3960): Billing service connected. 04-20 22:26:54.910: D/IabHelper(3960): Checking for in-app billing 3 support. 04-20 22:26:54.915: D/IabHelper(3960): In-app billing version 3 supported for com.trivialdrivesample.free 04-20 22:26:54.925: D/IabHelper(3960): Subscriptions AVAILABLE. 04-20 22:26:54.925: D/TrivialDrive(3960): Setup finished. 04-20 22:26:54.925: D/TrivialDrive(3960): Setup successful. Querying inventory. 04-20 22:26:54.925: D/IabHelper(3960): Starting async operation: refresh inventory 04-20 22:26:54.935: D/IabHelper(3960): Querying owned items, item type: inapp 04-20 22:26:54.935: D/IabHelper(3960): Package name: com.trivialdrivesample.free 04-20 22:26:54.935: D/IabHelper(3960): Calling getPurchases with continuation token: null 04-20 22:26:54.955: D/CLIPBOARD(3960): Hide Clipboard dialog at Starting input: finished by someone else... ! 04-20 22:26:54.965: D/IabHelper(3960): Owned items response: 0 04-20 22:26:54.965: D/IabHelper(3960): Continuation token: null 04-20 22:26:54.965: D/IabHelper(3960): Querying SKU details. 04-20 22:26:54.965: D/IabHelper(3960): queryPrices: nothing to do because there are no SKUs. 04-20 22:26:54.965: D/IabHelper(3960): Querying owned items, item type: subs 04-20 22:26:54.965: D/IabHelper(3960): Package name: com.trivialdrivesample.free 04-20 22:26:54.965: D/IabHelper(3960): Calling getPurchases with continuation token: null 04-20 22:26:54.975: D/IabHelper(3960): Owned items response: 0 04-20 22:26:54.975: D/IabHelper(3960): Continuation token: null 04-20 22:26:54.975: D/IabHelper(3960): Querying SKU details. 04-20 22:26:54.975: D/IabHelper(3960): queryPrices: nothing to do because there are no SKUs. 04-20 22:26:54.975: D/IabHelper(3960): Ending async operation: refresh inventory 04-20 22:26:54.975: D/TrivialDrive(3960): Query inventory finished. 04-20 22:26:54.975: D/TrivialDrive(3960): Query inventory was successful. 04-20 22:26:54.975: D/TrivialDrive(3960): User is NOT PREMIUM 04-20 22:26:54.975: D/TrivialDrive(3960): User DOES NOT HAVE infinite gas subscription. 04-20 22:26:55.000: D/dalvikvm(3960): GC_EXTERNAL_ALLOC freed 29K, 49% free 2762K/5379K, external 467K/513K, paused 23ms 04-20 22:26:55.005: D/TrivialDrive(3960): Initial inventory query finished; enabling main UI. 04-20 22:27:03.490: D/TrivialDrive(3960): Buy gas button clicked. 04-20 22:27:03.495: D/TrivialDrive(3960): Launching purchase flow for gas. 04-20 22:27:03.495: D/IabHelper(3960): Starting async operation: launchPurchaseFlow 04-20 22:27:03.495: D/IabHelper(3960): Constructing buy intent for gas, item type: inapp 04-20 22:27:03.550: D/IabHelper(3960): Launching buy intent for gas. Request code: 10001 04-20 22:27:03.620: D/CLIPBOARD(3960): Hide Clipboard dialog at Starting input: finished by someone else... ! 04-20 22:27:16.580: D/TrivialDrive(3960): onActivityResult(10001,0,Intent { (has extras) } 04-20 22:27:16.580: D/IabHelper(3960): Ending async operation: launchPurchaseFlow 04-20 22:27:16.580: D/IabHelper(3960): Purchase canceled - Response: 5:Developer Error 04-20 22:27:16.580: D/TrivialDrive(3960): Purchase finished: IabResult: User canceled. (response: -1005:User cancelled), purchase: null 04-20 22:27:16.580: E/TrivialDrive(3960): ** TrivialDrive Error: Error purchasing: IabResult: User canceled. (response: -1005:User cancelled) 04-20 22:27:16.580: D/TrivialDrive(3960): Showing alert dialog: Error: Error purchasing: IabResult: User canceled. (response: -1005:User cancelled) 04-20 22:27:16.710: D/dalvikvm(3960): GC_EXTERNAL_ALLOC freed 61K, 48% free 2840K/5379K, external 917K/920K, paused 21ms 04-20 22:27:16.715: D/TrivialDrive(3960): onActivityResult handled by IABUtil.

2
It would help you to receive assistance if you: 1. Formatted your logcat so that people could easily read it. 2. Described what you were expecting to see, and what you are actually seeing, and why this seems problematic to you. 3. Did some research and presented what you had learned, so that it's clear to us exactly what you cannot figure out.Carl
Thank you for your comments. So I'll start again. When I try to run the simulation on a test device, after making sure the set up is as it should be, when I press on the 'Buy Gas' button, it goes to the Google Play screen showing the item I published in the app, but then it shows an alert box saying 'Application error' with message: This version of the application is not configured for billing etc....' I'm don't understand why its doing that. The resultCode is 0 obviously. Here is the logcat:user1487034
...The resultCode is 0 obviously. I'm sorry I can't add the logcat, the windown is not giving me enough space to add it. Any ideas?(The GP app is version 3)user1487034
You can edit your original question to include a properly-formatted logcat, with carriage returns between the lines. Check out the formatting tools available on the editor so that you can place the logcat in its own block of text. You might also want to add your description of what happens, as not everyone will read the comment area.Carl
Then, go to this page: stackoverflow.com/questions/5522323/… This page suggests that you're probably running your app directly from Eclipse using the debug key, rather than having generated an APK signed with your own, unique developer key. You must have uploaded a signed APK to Google Play prior to testing, and you need to use the same APK (it can be revised, but the version code must match the one you uploaded, and it must be signed with the same key) on your own device when you are testing).Carl

2 Answers

3
votes

Based on your comments above, the problem now seems clear:

When you download the app to your device from Eclipse, Eclipse automatically signs your APK with your debug key (which is typically automatically generated by Eclipse), whereas the APK that you uploaded would have to be signed with your own (non-debug) signing key (because otherwise Google Play would not accept it). So, the signature of the file with which you are testing (from Eclipse) and that of the uploaded APK, do not match. That is what is causing the error that indicates that your app is not configured for billing.

You do not have to receive the APK directly from Google Play for testing; you can just load the same signed APK as you uploaded to Google Play from your PC, via a USB cable. In fact, so long as your local APK has the same signature and the same VersionCode as the APK that you uploaded, you can send it to your device over USB using ADB and it should run. This is important because when you are testing you will want to make various minor fixes without having to re-upload and wait several hours each time before testing.

0
votes

Thank you Carl for you points. I read over and over again and seemed to do everything right, except I was uploading the APK direct from Eclipse to the phone via a cable. The documentation is not clear enough. It should say that the app must only be downloaded from GP, and not from any development environment. The minute I did that, it worked. Thanks again. I'm off to working on my real app now for IAB. ;-)