Code
10
SDK error · code 10
What it means
networkError (code 10) means a request could not finish on the network: a timeout, a dropped connection, an unreachable host, a TLS failure or an unreadable response. It is temporary. The SDK keeps unposted purchases and sends them again later. Check the device's connection and your proxy URL, retry the screen with a short backoff, and never grant access from the error.
Code
10
iOS (Swift)
ErrorCode.network
Android (Kotlin)
PurchasesErrorCode.Network
Causes
URLSession failure other than "not connected to the Internet" (which becomes offlineConnectionError) maps here, and so does a request the SDK could not build (NetworkError.swift).IOException or JSONException while performing the request (errors.kt).NETWORK_ERROR, which Google describes as a network connection problem between the device and Play and says to retry with backoff (Google docs).http instead of https, a missing port, or localhost on an Android emulator, where localhost is the emulator itself.http:// server fails unless you allow it for that host.Fix
Retry the action after a short wait, and back off if it fails again. Google recommends simple retries or exponential backoff for NETWORK_ERROR.
Set the proxy URL before configure. On an Android emulator use http://10.0.2.2:8787 for a server on your computer, or use HTTPS. See common problems.
On iOS, call PurchasesDiagnostics.default.testSDKHealth(). It reports whether the SDK can reach the server and whether the API key is valid.
On iOS, NSUnderlyingErrorKey holds the URLError with the real reason, such as a timeout or a TLS failure. On Android read underlyingErrorMessage.
In your app
// Swift
do {
let result = try await Purchases.shared.purchase(package: package)
} catch let error as ErrorCode where error == .networkError {
// handle network error
}
// Kotlin
if (error.code == PurchasesErrorCode.NetworkError) { /* ... */ } On RevenueDot: If RevenueDot is unreachable, the SDK sees a connection error. If it answers 5xx, which it does for its own failures and store outages, the SDK keeps the purchase unfinished and computes access on the device from the product-to-entitlement mapping the server provides. See offline entitlements and 4xx or 5xx on a receipt.
FAQ
A request failed on the network: a timeout, a dropped connection, an unreachable host, a TLS failure or an unreadable response. With a self-hosted server, a wrong proxy URL is the most common cause.
No. The SDK keeps the store transaction unfinished when it cannot post it, and posts it again later. The customer's access appears once the post succeeds.
On an emulator, localhost is the emulator itself. Use http://10.0.2.2:<port> for a server on your computer, and allow cleartext HTTP for that host or use HTTPS.
In React Native, compare error.code with PURCHASES_ERROR_CODE.NETWORK_ERROR. In Flutter, convert the PlatformException with PurchasesErrorHelper.getErrorCode(e) and compare the result with PurchasesErrorCode.networkError.
Get started
RevenueDot answers the same SDK calls with the same error codes. Start free on RevenueDot Cloud, free up to $10,000 a month in tracked revenue.
Already have an account? Sign in · Prefer your own servers? Self-host free