I'm getting
"User is not eligible for this purchase"
message from google play while trying to purchase as a test.
I've uploaded singed apk in google play, published the billing item(in app product), saved the apk as draft, still getting this error.
Also I was trying to purchase from test user device.
Edit:
The actual reason for this error:
If an unauthorized user try to purchase an item then this message
should appear.
So if the App is not published, a non test user should get this error while try to purchase.
I realized that, Google play takes time to update the changes in app store. So you can not expect the changes immediately. Rather you should wait, in my case it took average 2/3 hours.
Still there may be some unknown error, which I could not figure.
My Cases:
First I was trying to purchase from my test device still got this error, But after waiting some time I didn't get this error. So I think the time was reason here.
Secondly I was trying from a non test device, which was an unauthorized device as the app was not published.
You must use, only, Test Account for Testing purposes. You can not use market account or others for purchasing your app while Testing.
From Android Docs
The synchronous response for a CHECK_BILLING_SUPPORTED request provides a Bundle with a server response code. A RESULT_OK response code indicates that in-app billing is supported; a RESULT_BILLING_UNAVAILABLE response code indicates that in-app billing is unavailable because the API version you specified is unrecognized or the user is not eligible to make in-app purchases (for example, the user resides in a country that does not allow in-app billing). A SERVER_ERROR can also be returned, indicating that there was a problem with the Google Play server.
see details here
This error comes when everything you done is perfect, you have used signed APK with the proper product id, but you have to note that the account that you are using might don't have proper valid credit card details.
So whenever you want to buy any product even with test account, that account should have valid credit details.
You have to specify test account in Edit profile of your publisher account
Licensing & In-app Billing
Test Accounts box
There is a now an additional situation which can result in the "User is not eligible" message.
It comes down to this recent change in the licensing system:
The Licensing keys are now managed for each app individually. To see
the license key for an application, switch to the new design and go
to the Services and APIs for the application
You can no longer use the old "shared" license key when creating new apps. You must switch the Google play developer console to the "new design" and use the license key for each specific app from that app's Services and APIs section.
If you try to use the old shared key the behavior is as follows:
If app is not yet published, tester will receive "User is not
eligible for this purchase" message.
If app is published, user will go through purchase process and
be charged for purchase, but the app will not receive a "purchase success" message.
TL;DR: Make sure you are using the new per-app license key and that you have copied it correctly.
I had the same issue.
I fixed it by uploading apk via "Old Design" of Developer Console.
Steps:
rename application package.
create release build and sign it with your developer key.
upload it to the Developer Console Old Design. You will be asked about switching to the new design for getting public key. DON'T do it.
Perform all next actions from Old Design.
After creatind and publishing inApp content switch to the New Design and take your application security key.
Put new key to your application, rebiuld and resign.
Install your application to the device.
Wait 2-3 hours.
Profit.
lved it. There is some problem in the "New Design" of Developer Console. I deleted the apk and created a new app from "old design" and it worked. Price points(In-App products) got automatically added again as the app package name is exactly the same as old one I deleted.
Also make sured the new public key is used which is app specific now.
Make sure you fill in the #gmail.com address as a licensed test account. Other e-mail addresses associated with your Google account will NOT work.
For the "Unpublisched" app, enter your email account under "Account details" and "Gmail accounts with testing access" in Play Developer Console. Also one need to wait 24 hours.
The android:versionCode set in the Manifest must be the same as the one active in Google Play console
I met this problem and was bothered for one or two day.I delete the test device's gmail and added it again. After then it works.
Related
When I tried to buy all of items, then it returns the message like bellow
"The item you requested is not available for purchase."
And logcat logs.
09-04 10:06:25.374: D/Finsky(7185): 1 PurchaseFragment.handleError:
Error: PurchaseError{type=3 subtype=4} 09-04 10:06:25.374:
D/Finsky(7185): 1 PurchaseFragment.fail: Purchase failed:
PurchaseError{type=3 subtype=4}
I guess, purchase error code type 3 is billing api problem
BILLING_RESPONSE_RESULT_BILLING_UNAVAILABLE 3 Billing API version is
not supported for the type requested
But... It is a live app in GooglePlayStore and I could buy an item yesterday.
And also it seems that most user can buy items. So I think the hint is subtype=4. But I can't find information about subtypes.
FYI, The application region locked in my country. Is it the problem? But I can't find Google's announcement about it.
I have the same error , and fix the problem in this way :
In the APK section . Now tester email must be listed as testers in either Alpha or Beta Testing .
After add a tester list . the tester need to open the 'Join Test' url , after join the test , I can test the purchase .
It looks like Google changed their IAP policies again and now users must be listed as testers in either Alpha or Beta Testing. From there you must opt-in (log in to that Google account and go to the URL for your app in the Google Developer Console). I ran into the same issue and that was their recommendation.
Since our update things have changed a bit. This account will need to make sure and opt-in to the new testing-link.
Just confirmed that this fixed the issue. You must configure Alpha/Beta testers for each app you have in the developer console in order for those users to be able to make test purchases. Hope that helps!
I have encountered this error response when I published a new alpha/beta version of an app to the developer console, but it hasn't finished processing yet.
Try again in an hour or so - make sure you have opted in to be an alpha/beta tester and that you can see the appropriate alpha/beta version of the app in the Play Store and it should work.
In addition to user1454444, make sure you don't have the publisher account on the device either - It was always the case that the publisher account couldn't buy IAPs which meant you couldn't have the main account on the device to be the publisher account, if you were testing.
I have recently (like literally over the last weekend) discovered that even having the publisher account on at all - i.e. your main account is not the publisher, but the publisher account is on the device - this will cause a fail in the buying process.
I suffered with this issue but it solved very simply.
The real problem was "You cannot try billing test with developer account", even that was invited account from project owner. Only, none associated account can be tested for purchasement.
Here is another checklist I had tried.
Is Registered in Gameservice -> Test -> tester
Is Registered in Alpha or beta tester at
AppVersion->Alpha/Beta Management->Tester
Are there No developer account in chrome, g-mail, playstore, googlePlay? (Every developer account must be cleaned)
Is App published? (at lest as close alpha/beta)
Did you install app with invitation url?
Check base64 key, packagename.
Is item activated?
I want to test the in app subscription mechanism on android devices(In app billing V3. api).
How can I do this? I saw that testing with static responses is works only with the in app products. The beta/alpha testing supports the in app subscriptions?
Thank you.
You can test your app with in app purchase feature. you have to follow below steps for testing
Upload you final signed apk file to Google play.
Dont publish it
Add in app products
get in app products id and add to code
get base 64 key and add to product
sign apk and upload again
your app should be in draft mode
in you Google play account setting add your test account id
use the device which should have the primary account id similar to the one you have added on Google play test account.
Install signed apk you have uploaded to Google play to your device.
run application and test your features
Since there's no effective way to test subscription cancellation/renewal, I'm trusting Google's documentation that an expired subscription won't appear in purchased items (otherwise, whether cancelled but still valid, original or renewed, I don't care in my case).
To test the rest of my work flow I created a test consumable object so that I can re-buy/cancel it at will in the sandbox. This consumable simulates an active subscription. It's not full end-to-end testing, but given that Google's given us no better way to test subscriptions, it will at least give me a fair amount of confidence that my app behaves as expected, otherwise.
A few notes:
1) You can only test with a signed build. I added android:debuggable="true" to my AndroidManifest.xml (under
<application android:debuggable="true"...)
2) This way I can still connect and debug with breakpoints after installing via adb (you can attach to the process under the Devices view, normally visible in the DDMS perspective, look for the little green bug icon.)
So far, it's behaving as expected. I'm still in the process of testing but if I hit any snags I'll update.
In adittion to #Vaibhav-Agarwal if you only want test your app, you could have problems with the IDs (I have experienced with an app for a client).
In my case, to avoid this situation, I had to add a testing project with another special package (test.xxxx.xxxx.xxxx) and here add some in-app product with a trial of 7 days, then when I canceled a purchase I "only" had to wait 7 days to purchase again this subscription.
In this way also,you never had to make a refund, because the subscription with trial time, you haven't to pay until this trial time finish.
NOTE:
Draft Apps are No Longer Supported, you must use Alpha/Beta tester option
In spanish, you will read: "no se ha podido encontrar el elemento que intentabas comprar"
Google has been enhanced theirs In-app Billing testing options. I write this answer for those who coming through . Now, you can test In-app Billing in Sandbox as other platforms do. In order to do that you have to create license test accounts for authorized users.
In the Developer Console, go to Settings > Account details, then in the License Testing section, add the addresses to Gmail accounts with testing access field.
Notes :
Test subscription purchases recur daily, regardless of the product's subscription period.
Once you’ve added the users as license tester accounts and saved the change, within 15 minutes those users can begin making test purchases of your in-app products.
After you publish your app to an alpha or beta channel, your testers need to opt-in to your app’s alpha or beta test using the provided opt-in URL before they can make test purchases.
License test accounts must be on the user’s Android device. If the device has more than one account, the purchase will be made with the account that downloaded the app. If none of the accounts has downloaded the app, the purchase is made with the first account. Users can confirm the account that is making a purchase by expanding the purchase dialog.
For more visit the official documentation.
But you can test Google Play functionality with an unpublished app using static responses.
I am very confused about this, both from the developer site and other similar questions.
I am trying to use V3 in-app billing. Seems to work with the static responses. Want to move on to testing with test purchases using license test accounts.
Basically - it is not working.
A signed app has been uploaded to the developer site (over 6 hours ago), and the app installed on the device, whilst not being signed with the same release key (it's a debug build and key), should work because Android Developers says "you only need to upload your application as a draft application. However, you must sign your application with your release key before you upload it as a draft application. Also, the version number of the uploaded application must match the version number of the application you load to your device for testing". Ie the code on the device apparently doesn't need the same key providing versionCode matches.
My developer console login is - say - a#googlemail.com, and I have a license test address registered (on the developer console) of b#gmail.com. The primary account on my phone is also a#googlemail.com. However I do have a secondary account on there of b#gmail.com. I do NOT want to have to reset my phone and change its one and only account to b#gmail.com.
Android Developers says "The only way to change the primary account on a device is to do a factory reset, making sure you log on with your primary account first" which seems to imply I might have to. It also then says "If the device has more than one account, the purchase will be made with the account that downloaded the app. If none of the accounts has downloaded the app, the purchase is made with the first account" which partially contradicts the first statement. Most of the text on the site appears to apply to pre-V3 code, OS 1.4 etc, so I am not sure how relevant it is.
I notice that Google Play allows me to select the account to use, and both the above show up in the list. Therefore, if I select that second (test) account in Google Play, should that be not sufficient to start testing with that test account?
What actually happens is, whatever account I have selected in Google Play, on starting a purchase I get a message "this version of the application is not configured for billing through Google Play".
Is this because I really do have reset the device and make the primary account b#gmail.com, or because of something else, possibly in the code?
I have some more information now, together with the answer above:
Once I loaded the device with the release signed key the message on a purchase attempt changed to "the publisher cannot purchase own item".
I tried logging in to Google Play with both my accounts and it made no difference. When logged in with the test account I also tried to find the app in the play store. Didn't show up even to the test account (draft app). (I hoped the test account could download it even as draft and therefore following the rules above about multiple accounts I could test purchase with the test account, but no).
Therefore I conclude:
Can only test on a device with an app signed with the same key as the one uploaded to the play store - whatever Android Developers might say.
The ONLY account that can test purchases on a device is the first set (primary) account.
Best therefore to have a completely new account as one's Developer Console account (bit late now).
Would be happy to hear if anyone can contradict the above.
Sign the app you upload to the device with a release key. As far as I know you can't test in-app billing without signing it properly. Actually, last week I tried it as written above and it works.
Hope it helps.
You can have multiple accounts on your devices -- as many as you want. But while testing the app, make sure you don't install it by the app Play Store on your device. Instead, go to Google Chrome, browse to its page on Google Play, and install the app from there. There's a button Install (or Installed).
I guess if you already install the app from account A, then the Android app Play Store will use that account to install next version (or reinstall current version) -- even though you're signed in as another account, like B for example.
However the Google Chrome will just install the app via the current signed in account. This could be a bug and it would be fixed some day. But it's working right now -- when I'm typing this answer. Android team is well known of being lazy for delivering fixes. I hope this "bug" will never be fixed :-)
I am attempting to get google's example (in-app purchasing version 3) test app "TrivialDrive" to work, but have the following problem:
I click the "buy gas" button, this brings up the following screen:
There are two possible interpretations of this message:
The item is unavailable THEREFORE this user can not get it.
The user is somehow not eligible to purchase this item THEREFORE the item is unavailable.
So which is it? And why might I be getting this error anyway?
By the way the app has been uploaded to my developer account yesterday, so I have far exceeded the 2-3 hour wait Google recommends for the data to be in the system.
Also I have "Play Store" installed on the device.
Just for good measure here is a screen grab from my developer account:
I am running the app from a device registered with a gmail address which is on my developer's "Test Accounts" list.
EDIT: I just tested another app of mine which used the old-style (Version 2) billing system and it reported "Please first complete your account by adding a payment method". So it would seem that the lack of payment method was the ultimate cause - but I wouldn't want potential customers to be presented with such a useless and misleading error message. I did a search for "item unavailable" in the MainActivity.java and the strings.xml and found nothing, so am at a loss as to haw to avoid this scenario.
I see that you have yet to publish the overarching app that the in-app product is supposed to stem from. As a result, Google does not allow you to pay for an in-app product if the application itself has yet to be published. Once you release the application and publish it, you should be able to access the in-app product's sales page.
An in-app product will appear UNPUBLISHED until the owning application is published.
Even if you were to publish your in-app product, nobody can buy it until your actual application is.
Have you setup a test account? The test account should not be the your google play dev account.
Explained here
I have followed google instructions for implementing in-app purchases service.
I was provided access to Google Play developer console as invited user. I took private key from it, and added my google account to the input field with test accounts. After that I created APK file and signed it with valid certificate. Then uploaded application to Google Play but didn't publish it. After it I created needed in-app purchases and published them. Then installed same signed apk file on my device.
Right after publishing in-app purchases and for some period of time my application was giving me message like "not found", but some time later it became available. And now I can buy all the items from the application, but no one else who installed the same APK file can't. I tried to add their email addresses into list of test accounts in profile - no luck, even the user owner of the Google Play account can't buy anything. They keep receiving something like "item you selected is not available for purchase" When they try to buy test purchase item (the one that is described in documentation) they can successfuly get "android.test.purchased: PURCHASED"
Google Play takes a pretty long time to update its servers. When I was implementing in app billing the first time, I must have rewritten everything at least 50 times. Nothing changed, except some 12 hours later it all started working magically. Most likely their server hasn't updated yet. If you can use the test items correctly, then your implementation is likely fine, and you just need to wait for the servers to update.
Only the signed apk file that you uploaded in play store can be used to buy the in app product.
Did you give the in app id in the signed apk file before registering the in app id in play store.then only others can buy the item.
as per the edit
see you have use android.test.purchase ri8 it is an test id when your make your app real your need to replace that with your own in-app id.Then you have a question how to obtain in-app id.its very simple after saving your app(not published) in draft there is an option to add the in app product for your app.click that option where you will see the app id in one of the field then fill the in app id and also set corresponding amount for your product and publish the in-app product not the app.Replace the android.test.purchase with your new id in the signed apk and wait for some time so that the server can update your changes.