My application is a paid application which is also using apk expansion library.
For testing I have added a test account in my developer console say
xyz#gmail.com
And it's working as expected (Expansion files are downloaded) when I am testing with a device which was registered with above account first.
But the problem occurred when I installed a signed apk to a device which is already registered with
abc#gmail.com
I have added xyz#gmail.com account before the installation of signed apk, And as a checklist I made sure Gmail and Google Play are working properly with this account.
But upon running the app, I have got the error
"Download failed because you may not have purchased the app".
What should I do to test the application in above condition? Do I need to remove abc#gmail.com? Or is there any workaround?
It's done and final.
Android LVL aka Licencing verification library only fetches primary account (Google account you registered first for your device) to work with.
Quoting android's original documentation
The Google Play client collects the necessary information about the user and the device, such as the device's primary Google account username, IMSI, and other information. It then sends the license check request to the server on behalf of your application.
Related
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 :-)
My phone (Galaxy s3, OS v4.1) is having two Google accounts. One is added when I purchased my phone, and other I have added now.
Now I have installed my application for testing and it's having in-app purchase. When I tried to purchase, every time I get message like please first complete your account by adding a payment method.
I have installed signed app which is drafted on Play.
I have configured test account on Google developer console.
The Google account, configured in my phone, is having admin access to Google developer console. That is why I want to test in app product with my other Google account but when I am redirected to Google play market, It shows my first account every time. How can I test with my other account configured in my phone?
Is there any system like, this is primary account or this is secondary account?
I know this has been answered, but I had a different experience with the same message.
(please first complete your account by adding a payment method)
My eclipse adt and sdk were out of date. Updating those also updated the Trivial drive project which then had more detailed information in the readme file about how to properly setup and run the app.
Delete the google account from your phone with which you don't want to test.
This is the bug filed here.
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.
I have already wasted days with what seams to be an error in the Google license verification framework.
I am testing the Google market License Verification Library. I have thus far:
- created a library and test project from the provided library and sample sources with no changes (except public key and other obvious things).
- created a publisher account on market
- I have not uploaded the application to the market
- installed the sample application to a device
- In the developer console added test accounts
- I have set various test responses in the developer console
My problem is that I always get a NOT_MARKET_MANAGED response - regardless of settings in the developer console test response.
The docs state that I have to be signed in a device with a publisher account. It does not say what does this mean specifically.
I have added a publisher account to the accounts in the device but this does not help. Since the License Library depends on Market application I have changed the account in Marker application. No effect either.
I have googled around and found something in the line "… that I have to be signed in with publisher account as primary account…". What exactly is primary account remains vague. Some sources state that a factory reset is needed for a primary account sign in. I have not tried that but I think you loose whatever you made on the device, installs, messages, contacts and such. This is impossibly impractical.
My question is: How does one test the application against various responses?
On the developer console it is clearly stated:
This License Test Response will be sent to devices using
publisher_account or the Test Accounts listed above for applications
you have uploaded to Market. Additionally, this account (but not the
Test Accounts) will receive this response for applications that have
not yet been uploaded to Market.
The same is also stated in this section of docs:
http://developer.android.com/guide/publishing/licensing.html#test-acct-setup
I know that testing is possible with uploading the apk to the server. But besides setting the test response in developer console one has to do:
Compile the application without debug flag
Create a certificate
Sign the apk with certificate
Upload the apk to the server
All this is a major PITA. Something that could be just a simple run and test is now a whole procedure, just for testing the most basic functionality of a prototype.
Taken into consideration the discrepancy between the docs and License Verification Framework behavior there is only one possible conclusion. Either docs or implementation (or both) are flawed.
Please read the Official Dev Guide carefully:
Setting test responses for license checks
Android Market provides a configuration setting in your publisher account that lets you override the normal processing of a license check and return a specified static response code. The setting is for testing only and applies only to license checks for applications that you have uploaded, made by any user signed in to an emulator or device using the credentials of the publisher account or a registered test account. For other users, the server always processes license checks according to normal rules.
And follow David's comments.
Is it possible to use a Google Apps account as a test account with the Android License Verification Library?
I've done some testing and even though I have my Google Apps account listed, I always get back an unlicensed response. The only account I've ever had success testing with is one ending in #gmail.com
Thanks-
As per the note on the publisher site:
http://market.android.com/publish/editProfile
This response will be sent to devices
using xxxx#gmail.com or the Test
accounts listed above for applications
you have uploaded to Market.
Additionally, this account (but not
the Test accounts) will receive this
response for applications that have
not yet been uploaded to Market.
xxxx#gmail.com being the signin email for the publisher account.
If you take a look at the dev guides:
http://developer.android.com/guide/publishing/licensing.html#test-env
Point two maybe the solution to your troubles:
An optional set of test accounts that
will receive the static test response
when they check the license of an
application that you have uploaded
(regardless whether the application is
published or not).
Yes. You can use Google app account for LVL testing. As you mentioned, the Google app account (usually) wont end up with 'gmail.com'. That is perfectly fine.
I use google app account as my publisher account in market and gmail account as test account. The response is inline with Table 1 in this link
http://developer.android.com/guide/publishing/licensing.html#test-acct-setup