'Why am I getting DEVELOPER_ERROR response code when connecting my BillingClient?

/**
 * 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
 */
int DEVELOPER_ERROR = 5;

I am using Google Play Signing - so I upload App Bundles for releases. I'm wondering if that could somehow be related? (since Google Play is using its own signing key on their backend vs a local key)

I have the com.android.vending.BILLING permission in my manifest, and I'm able to use "test cards" with debug builds successfully. I only noticed this problem through Bugsnag reports where I am logging failure events.

Anyone know why this is happening?



Solution 1:[1]

In the Google Cloud Console, you need to configure the API credentials to whitelist your package name and the certificate. The certificate is the one that is listed as "App Signing certificate" in the "App Signing" page in the Play Console.

Solution 2:[2]

I got this same error when using BillingClient.queryPurchasesAsnyc(), where I got an empty BillingResult debug message and DEVELOPER_ERROR as a ResponseCode.

Turns out I passed BillingClient.FeatureType.SUBSCRIPTION instead of BillingClient.SkuType.SUBS to the function as specified in the documentation.

So be sure to double check your function parameters!

Solution 3:[3]

When billingClient.startConnection() is performed multiple times in a short period of time, the value of billingResult.responseCode becomes DEVELOPER_ERROR.

Solution 4:[4]

Modded/tampered APKs will trigger this error due to a different signature.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Pierre
Solution 2
Solution 3 Hashido Tomoya
Solution 4 kandrit