Skip to main content
Question

Bad error formatting

  • October 21, 2025
  • 2 replies
  • 30 views

Forum|alt.badge.img+2

Getting a NetworkError sometimes on `Purchases.sharedInstance.restorePurchases` (KMP SDK).

Minor bug report: `underlyingErrorMessage` seems to be a result of parsing HTML as JSON.

# java.lang.Throwable: PurchasesError(code=NetworkError, underlyingErrorMessage=Value <!DOCTYPE of type java.lang.String cannot be converted to JSONObject, message='Error performing request.')

## Issue Summary
Purchase History Network Error: Failed Device ID Linking
**What's wrong:** Failed to link device ID with purchases. **NetworkError** during purchase history retrieval. Internal error code 12.
**In the trace:** App entered foreground and resumed normally. **Network available** and capable.
**Possible cause:** A **transient server-side issue** with the purchase history API may have caused the network error.
 

This post has been closed for comments

2 replies

guilherme
RevenueCat Staff
Forum|alt.badge.img+6
  • RevenueCat Staff
  • October 23, 2025

Hey ​@user-0a9831 ,

Are you able to replicate this consistently? And if so, could you describe the conditions of it:

  • during which action or user journey are you seeing this happening more frequently?
  • does this happen in Sandbox or Production environment?
  • does this happen for both on Android and iOS platforms?
  • on the devices it happens, can you share their OS version and model?
  • the SDK version you are currently using?

Also, could you confirm that you are only calling the configure() once during your app’s lifecycle?  Calling the method multiple times can have side effects that are not expected, so just looking to understand if this is a possibility.


Forum|alt.badge.img+2
  • Author
  • Active Member
  • October 27, 2025

@guilherme Unfortunately the error was removed, so can’t get more infos. But I upgraded recently the SDK from a quite old version, so at least the HTML issue might be fixed. Will update if I experience it again.