You need to sign your APK with your live certificate. Then install that onto your test device. You can then test InAppBilling. If you are testing your application by direct run via eclipse to device(In debug mode) then you will get this error.
Go to Android Settings > Applications (also known as Apps & notifications on some devices) > Google Play Store > Storage > tap on Clear storage and Clear cache. Repeat the same steps for Google Services framework. Try buying again. If you still have an error, try step 2.
This error may be caused by several reasons.
Here is the list of requirements for the Google IAB testing.
Prerequisites:
Testing requirements:
P.S: Debugging with release certificate: https://stackoverflow.com/a/15754187/1321401 (Thnx @dipp for the link)
P.P.S: Wanted to make this list for a long time already.
Thnx @zlgdev, @Kyone, @MinosL for updates
Ahh found the solution after trying for a couple of hours.
The same will happen if your published version is not the same as the version you're testing on your phone.
For example, uploaded version is android:versionCode="1"
, and the version you're testing on your phone is android:versionCode="2"
In the old developer console:
Settings
-> Account details
-> License Testing
-> Gmail accounts with testing access and type here your accounts
In new developer console:
Settings
-> License Testing
-> Type your Gmail account, hit 'Enter' and click 'Save'.
You need to sign your APK with your live certificate. Then install that onto your test device. You can then test InAppBilling. If you are testing your application by direct run via eclipse to device(In debug mode) then you will get this error.
If you are using android.test.purchased
as the SKU, it will work all the way, but you won't have the developerPayload in your final response.
If you are using your own draft in app item you can test all the way but you will be charged and so will have to refund it yourself afterwards.
You cannot buy items with the same gmail account that you use for the google play development console.
Conclusions in 2021
For all of you who concerned about debugging - You CAN run and debug and test the code in debug mode
Here's how you can test the process:
(This of course relies on the fact that you have already added and activated your products, and your code is ready for integration with those products)
I did the above and it is working just fine.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With