Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting response code as 5 in inapp billing consumption android

Actually i am trying to do In-App Purchase in android and i have downloaded the trivial drive from android sdk. I can do the purchase sucessfully by calling launchPurchaseFlow method but the problem is when i try to consume the product by calling consumeAsync method im getting the response code as 5 (Developer Errror). this is the code i am executing after the purchase was sucessfull

mHelper.consumeAsync(inventory.getPurchase(SKU_GAS), mConsumeFinishedListener);

anyone please provide me the solution ASAP.

like image 322
karthik_neversayno Avatar asked Dec 11 '22 17:12

karthik_neversayno


2 Answers

Developer Error (code = 5) usually means that you’re testing with an app that is either signed differently than the APK you uploaded via the Developer Console, or which has a different version/version code than the APK that you uploaded.

Per the doc (http://developer.android.com/google/play/billing/billing_reference.html):

"Invalid arguments provided to the API. This error can also indicate that the application was not correctly signed or properly set up for In-app Billing in Google Play, or does not have the necessary permissions in its manifest"

If you're testing with an APK signed with a debug key, for example, you might get this error. It should be signed with the same key as the APK that was uploaded to the Google Play store's Developer Console for testing (typically, the key you will use for the released app).

Also, if you're testing with an APK that has a version code that differs from that of the APK presently uploaded to the Developer Console, you may receive this error code 5 (developer error).

like image 151
Carl Avatar answered Jan 17 '23 16:01

Carl


There are existing questions on this. It is a temporary (we hope) but introduced around 3/8/13. Please star and comment on this bug report: https://code.google.com/p/android/issues/detail?id=53077.

like image 41
user2159258 Avatar answered Jan 17 '23 15:01

user2159258