My experience on this error is:
Make sure to upload the signed APK to developer console.
Make sure to install the signed APK on your device not launch the app in the debugger.
Make sure to create a test account in your developer console.
Setup you testing account
- Make sure to sign in your device with your test account.
- In a case of closed alpha/beta testing, make sure you have added your test account to selected testers group, you can do this on the page of management your alpha/beta version.
- In a case of closed alpha/beta testing, make sure your testing account have accepted participation in testing of this application via special invite link
Make sure to create in app billing in your developer console and finally activate the item from the console!!! (this is the one that got me after fully following google's tutorial)
Make sure to set VersionCode and VersionName in the manifest to be the same as the version in the developer console (Alpha, Beta or Production. Drafts does not work anymore). @alexgophermix answer worked for me.
If you're looking for testing payments without actual money withdrawal, you need additionally add your testing account to another special list of accounts "Gmail accounts with testing access", you can find that on play account setting(not project!). On the page where you can see a list of your projects go to settings, and then on "Account details" page (scroll down, it's almost in the bottom of page) you will find the "Gmail accounts with testing access" list.
Android R Update:
From Android R, this method always returns false. Google says that this is done "to protect goat privacy":
/**
* Used to determine whether the user making this call is subject to
* teleportations.
*
* <p>As of {@link android.os.Build.VERSION_CODES#LOLLIPOP}, this method can
* now automatically identify goats using advanced goat recognition technology.</p>
*
* <p>As of {@link android.os.Build.VERSION_CODES#R}, this method always returns
* {@code false} in order to protect goat privacy.</p>
*
* @return Returns whether the user making this call is a goat.
*/
public boolean isUserAGoat() {
if (mContext.getApplicationInfo().targetSdkVersion >= Build.VERSION_CODES.R) {
return false;
}
return mContext.getPackageManager()
.isPackageAvailable("com.coffeestainstudios.goatsimulator");
}
Previous answer:
From their source, the method used to return false
until it was changed in API 21.
/**
* Used to determine whether the user making this call is subject to
* teleportations.
* @return whether the user making this call is a goat
*/
public boolean isUserAGoat() {
return false;
}
It looks like the method has no real use for us as developers. Someone has previously stated that it might be an Easter egg.
In API 21 the implementation was changed to check if there is an installed app with the package com.coffeestainstudios.goatsimulator
/**
* Used to determine whether the user making this call is subject to
* teleportations.
*
* <p>As of {@link android.os.Build.VERSION_CODES#LOLLIPOP}, this method can
* now automatically identify goats using advanced goat recognition technology.</p>
*
* @return Returns true if the user making this call is a goat.
*/
public boolean isUserAGoat() {
return mContext.getPackageManager()
.isPackageAvailable("com.coffeestainstudios.goatsimulator");
}
Here is the source and the change.
Best Answer
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