Question

[Android SDK] Error updating purchases. ErrorCode: 6

  • 3 January 2022
  • 4 replies
  • 92 views

Badge

Hello all,

we have observed that some of our users that try to buy our product are ending up with the following error:

Error updating purchases. DebugMessage: . ErrorCode: 6

From what I have seen in Android’s SDK, this points to Play Billing’s API internal error.

Are there any way to mitigate this? We have a suspicion that this greatly reduces our conversions rate compared to other means of in-app payments.

 

(source of the error message: https://github.com/RevenueCat/purchases-android/blob/f7fac296913c531dc132b243f17ba0d05922c07b/feature/google/src/main/java/com/revenuecat/purchases/google/BillingWrapper.kt#L523)


4 replies

Userlevel 5
Badge +8

Hey @MarcinScana!

This is kind of a weird error, and even Google isn’t very specific about what it actually means. It seems to be some kind of generic error that can be triggered by multiple issues- there have been reports of this error indicating:

  1. A timeout when interacting with BillingClient [link] (maybe an old device with a resource-intensive app)
  2. An error due to sideloading apps instead of installing directly from Google Play [link]

Do you have any logs or device information about the users encountering the error?

Badge

Hey @cody we have managed to collect logs from the SDK, but unfortunately they do not tell us much - maybe your team could find anything interesting there?

ℹ️ Debug logging enabled
ℹ️ SDK Version - 4.6.1
👤 Initial App User ID - null
👤 Setting new anonymous App User ID - %s
👤 Identifying App User ID: $RCAnonymousID:1ad0f4f2058f4886868844b6aa7361b8
ℹ️ Deleting old synced subscriber attributes that don't belong to $RCAnonymousID:1ad0f4f2058f4886868844b6aa7361b8
ℹ️ Starting connection for com.android.billingclient.api.d@2f4a970
ℹ️ App foregrounded
ℹ️ PurchaserInfo cache is stale, updating from network in foreground.
ℹ️ Offerings cache is stale, updating from network in foreground
😻 Offerings updated from network.
ℹ️ Skipping updating pending purchase queue since BillingClient is not connected yet.
ℹ️ No subscriber attributes to synchronize.
ℹ️ Billing Service Setup finished for com.android.billingclient.api.d@2f4a970
ℹ️ Updating pending purchase queue
ℹ️ API request started: GET /subscribers/%24RCAnonymousID%3A1ad0f4f2058f4886868844b6aa7361b8
ℹ️ API request completed with status: GET /subscribers/%24RCAnonymousID%3A1ad0f4f2058f4886868844b6aa7361b8 201
ℹ️ API request started: GET /subscribers/%24RCAnonymousID%3A1ad0f4f2058f4886868844b6aa7361b8/offerings
ℹ️ API request completed with status: GET /subscribers/%24RCAnonymousID%3A1ad0f4f2058f4886868844b6aa7361b8/offerings 200
ℹ️ SKU list is empty, skipping querySkuDetailsAsync call
ℹ️ Querying purchases
ℹ️ Cleaning previously sent tokens
ℹ️ Tokens already posted: []
ℹ️ Saving tokens []
ℹ️ Tokens already posted: []
ℹ️ Requesting products from the store with identifiers: com.brainly.annual, com.brainly.semiannual
ℹ️ Products request finished for com.brainly.annual, com.brainly.semiannual
💰 Retrieved skuDetailsList: SkuDetails: {"productId":"com.brainly.annual","type":"subs","title":"Brainly Plus, Annual (Brainly – Get Homework Help)","name":"Brainly Plus, Annual","price":"R$ 84,00","price_amount_micros":84000000,"price_currency_code":"BRL","description":"Annual subscription for Brainly Plus","subscriptionPeriod":"P1Y","skuDetailsToken":"<REDACTED>"}, SkuDetails: {"productId":"com.brainly.semiannual","type":"subs","title":"Brainly Plus, Semi-Annual (Brainly – Get Homework Help)","name":"Brainly Plus, Semi-Annual","price":"R$ 66,00","price_amount_micros":66000000,"price_currency_code":"BRL","description":"Semi-annual subscription for Brainly Plus","subscriptionPeriod":"P6M","skuDetailsToken":"<REDACTED>"}
💰 com.brainly.annual - SkuDetails: {"productId":"com.brainly.annual","type":"subs","title":"Brainly Plus, Annual (Brainly – Get Homework Help)","name":"Brainly Plus, Annual","price":"R$ 84,00","price_amount_micros":84000000,"price_currency_code":"BRL","description":"Annual subscription for Brainly Plus","subscriptionPeriod":"P1Y","skuDetailsToken":"<REDACTED>"}
💰 com.brainly.semiannual - SkuDetails: {"productId":"com.brainly.semiannual","type":"subs","title":"Brainly Plus, Semi-Annual (Brainly – Get Homework Help)","name":"Brainly Plus, Semi-Annual","price":"R$ 66,00","price_amount_micros":66000000,"price_currency_code":"BRL","description":"Semi-annual subscription for Brainly Plus","subscriptionPeriod":"P6M","skuDetailsToken":"<REDACTED>"}
👤 Logging in from $RCAnonymousID:1ad0f4f2058f4886868844b6aa7361b8 -> <REDACTED>
ℹ️ API request started: POST /subscribers/identify
ℹ️ API request completed with status: POST /subscribers/identify 201
👤 Logged in successfully as <REDACTED>. Created: true
ℹ️ Found 0 unsynced attributes for App User ID: $RCAnonymousID:1ad0f4f2058f4886868844b6aa7361b8
ℹ️ Deleting subscriber attributes for $RCAnonymousID:1ad0f4f2058f4886868844b6aa7361b8 from cache
ℹ️ Requesting products from the store with identifiers: com.brainly.annual
ℹ️ API request started: GET /subscribers/<REDACTED>/offerings
ℹ️ API request completed with status: GET /subscribers/<REDACTED>/offerings 200
ℹ️ SKU list is empty, skipping querySkuDetailsAsync call
ℹ️ Products request finished for com.brainly.annual
💰 Retrieved skuDetailsList: SkuDetails: {"productId":"com.brainly.annual","type":"subs","title":"Brainly Plus, Annual (Brainly – Get Homework Help)","name":"Brainly Plus, Annual","price":"R$ 84,00","price_amount_micros":84000000,"price_currency_code":"BRL","description":"Annual subscription for Brainly Plus","subscriptionPeriod":"P1Y","skuDetailsToken":"<REDACTED>"}
💰 com.brainly.annual - SkuDetails: {"productId":"com.brainly.annual","type":"subs","title":"Brainly Plus, Annual (Brainly – Get Homework Help)","name":"Brainly Plus, Annual","price":"R$ 84,00","price_amount_micros":84000000,"price_currency_code":"BRL","description":"Annual subscription for Brainly Plus","subscriptionPeriod":"P1Y","skuDetailsToken":"<REDACTED>"}
💰 Purchase started - product: com.revenuecat.purchases.models.ProductDetails@69cf9b29 - offering:
💰 Purchasing product: com.brainly.annual
💰 Purchasing user's id: {<REDACTED>}
🤖‼️ BillingWrapper purchases failed to update: DebugMessage: . ErrorCode: 1.null
🤖‼️ Purchase was cancelled.
ℹ️ Requesting products from the store with identifiers: com.brainly.annual, com.brainly.semiannual
ℹ️ Products request finished for com.brainly.annual, com.brainly.semiannual
💰 Retrieved skuDetailsList: SkuDetails: {"productId":"com.brainly.annual","type":"subs","title":"Brainly Plus, Annual (Brainly – Get Homework Help)","name":"Brainly Plus, Annual","price":"R$ 84,00","price_amount_micros":84000000,"price_currency_code":"BRL","description":"Annual subscription for Brainly Plus","subscriptionPeriod":"P1Y","skuDetailsToken":"<REDACTED>"}, SkuDetails: {"productId":"com.brainly.semiannual","type":"subs","title":"Brainly Plus, Semi-Annual (Brainly – Get Homework Help)","name":"Brainly Plus, Semi-Annual","price":"R$ 66,00","price_amount_micros":66000000,"price_currency_code":"BRL","description":"Semi-annual subscription for Brainly Plus","subscriptionPeriod":"P6M","skuDetailsToken":"<REDACTED>"}
💰 com.brainly.annual - SkuDetails: {"productId":"com.brainly.annual","type":"subs","title":"Brainly Plus, Annual (Brainly – Get Homework Help)","name":"Brainly Plus, Annual","price":"R$ 84,00","price_amount_micros":84000000,"price_currency_code":"BRL","description":"Annual subscription for Brainly Plus","subscriptionPeriod":"P1Y","skuDetailsToken":"<REDACTED>"}
💰 com.brainly.semiannual - SkuDetails: {"productId":"com.brainly.semiannual","type":"subs","title":"Brainly Plus, Semi-Annual (Brainly – Get Homework Help)","name":"Brainly Plus, Semi-Annual","price":"R$ 66,00","price_amount_micros":66000000,"price_currency_code":"BRL","description":"Semi-annual subscription for Brainly Plus","subscriptionPeriod":"P6M","skuDetailsToken":"<REDACTED>"}
ℹ️ Vending PurchaserInfo from cache.
ℹ️ Checking if cache is stale AppInBackground false
ℹ️ Requesting products from the store with identifiers: com.brainly.annual
ℹ️ Products request finished for com.brainly.annual
💰 Retrieved skuDetailsList: SkuDetails: {"productId":"com.brainly.annual","type":"subs","title":"Brainly Plus, Annual (Brainly – Get Homework Help)","name":"Brainly Plus, Annual","price":"R$ 84,00","price_amount_micros":84000000,"price_currency_code":"BRL","description":"Annual subscription for Brainly Plus","subscriptionPeriod":"P1Y","skuDetailsToken":"AEuhp4LQWlxBLXlfnPWHrsJl1jBjL0u6CGuQPx6lArCuqfAWiNf2sgwVTOxgUywlCQOj"}
💰 com.brainly.annual - SkuDetails: {"productId":"com.brainly.annual","type":"subs","title":"Brainly Plus, Annual (Brainly – Get Homework Help)","name":"Brainly Plus, Annual","price":"R$ 84,00","price_amount_micros":84000000,"price_currency_code":"BRL","description":"Annual subscription for Brainly Plus","subscriptionPeriod":"P1Y","skuDetailsToken":"AEuhp4LQWlxBLXlfnPWHrsJl1jBjL0u6CGuQPx6lArCuqfAWiNf2sgwVTOxgUywlCQOj"}
💰 Purchase started - product: com.revenuecat.purchases.models.ProductDetails@67fe20f3 - offering:
💰 Purchasing product: com.brainly.annual
💰 Purchasing user's id: {<REDACTED>}
🤖‼️ BillingWrapper purchases failed to update: DebugMessage: . ErrorCode: 6.null
🤖‼️ There was a problem with the Play Store."

 

Badge

Some logcat logs that we have collected - not sure if this helps with anything:

01-31 00:21:14.501 17503 17503 W BillingHelper: Couldn't find purchase lists, trying to find single data.01-31 00:21:14.501 17503 17503 W BillingHelper: Received a bad purchase data.01-31 00:21:14.501 17503 17503 W BillingHelper: Couldn't find single purchase data as well.
Userlevel 5
Badge +8

Hey @MarcinScana,

Thanks for sending those logs over! I was able to take a look on our end and see that the error is happening before anything is sent to RevenueCat, so I’m not able to see a specific error on my end. It seems like timeouts might be causing it since it’s never reaching us.

The logcat errors are interesting - is that error happening when you are testing? There also isn’t a whole lot of documentation about those types of error messages, and I haven’t actually seen that before. I did find this blog post referencing it though: https://medium.com/swlh/some-things-we-learned-while-implementing-in-app-purchase-in-android-9e70c22addf0

After some hours of searching why we got this error, turns out you need to add the email you are signed in on the Google Play app from your phone to the licensed testers list. And you can do that in the Google Play Console. On the page with all apps you can find Settings ->License Testing. Here you add the email address, press Enter, and save your changes.

Could you try that and see if it resolves the error in your own testing?

Reply