Handle errors in Kotlin Multiplatform SDK

This page covers error handling in the Adapty Kotlin Multiplatform SDK.

Error handling basics

All Adapty SDK methods return results that can be either success or error. Always handle both cases:

Common error codes

AdaptyError.code is an AdaptyErrorCode enum value, not a number — compare it against the enum constant, not against the numeric code. The numbers below are shown only because they are what a log line or a support ticket usually carries.

Error codeNumberDescriptionSolution
AdaptyErrorCode.NO_PRODUCT_IDS_FOUND1000None of the products in the paywall are available in the store.See Fix for Code-1000 noProductIDsFound error.
AdaptyErrorCode.CANT_MAKE_PAYMENTS1003In-app purchases are not allowed on this device.See Fix for Code-1003 cantMakePayments error.
AdaptyErrorCode.PRODUCT_NOT_FOUND22The product requested for purchase is not available in the store.Check that the product is configured in the store and in the Adapty Dashboard.
AdaptyErrorCode.NETWORK_FAILED2005The network request failed.Ask the user to check their connection, or retry the call.
AdaptyErrorCode.ADAPTY_NOT_INITIALIZED20The SDK was not activated before the call.Wait for Adapty.activate to complete before any other SDK call.

For the full list of codes, see AdaptyErrorCode in the SDK models reference.

Handle specific errors

Network errors

Purchase errors

Error recovery strategies

Retry on network errors

Fallback to cached data

Next steps