Skip to main content

Handle errors in Flutter SDK

Every error is returned by the SDK is AdaptyErrorCode. Here is an example:

important

If these solutions don't resolve your issue, see Other issues for steps to take before contacting support to help us assist you more efficiently.

    try {
final result = await adapty.makePurchase(product: product);
} on AdaptyError catch (adaptyError) {
if (adaptyError.code == AdaptyErrorCode.paymentCancelled) {
// Cancelled
}
} catch (e) {
}

 System StoreKit codes

ErrorCodeSolution
unknown0Error code indicating that an unknown or unexpected error occurred.
Retry or see the Other issues section.
clientInvalid1This error code indicates that the client is not allowed to perform the attempted action.
paymentCancelled2

This error code indicates that the user canceled a payment request.

No action is required, but in terms of the business logic, you can offer a discount to your user or remind them later.

paymentInvalid3This error indicates that one of the payment parameters was not recognized by the App Store.
paymentNotAllowed4This error code indicates that the user is not allowed to authorize payments.
storeProductNotAvailable5This error code indicates that the requested product is not available in the store.
Try re-installing the app.
cloudServicePermissionDenied6This error code indicates that the user has not allowed access to Cloud service information.
cloudServiceNetworkConnectionFailed7This error code indicates that the device could not connect to the network.
cloudServiceRevoked8This error code indicates that the user has revoked permission to use this cloud service.
privacyAcknowledgementRequired9This error code indicates that the user has not yet acknowledged Apple’s privacy policy.
unauthorizedRequestData10This error code indicates that the app is attempting to use a property for which it does not have the required entitlement.
invalidOfferIdentifier11

The offer identifier is not valid. For example, you have not set up an offer with that identifier in the App Store, or you have revoked the offer.

Make sure you set up desired offers in AppStore Connect and pass a valid offer identifier.

invalidSignature12This error code indicates that the signature in a payment discount is not valid.
missingOfferParams13This error code indicates that parameters are missing in a payment discount.
invalidOfferPrice14This error code indicates that the price you specified in App Store Connect is no longer valid. Offers must always represent a discounted price.

Custom Android codes

ErrorCodeSolution
adaptyNotInitialized20You need to properly configure Adapty SDK by Adapty.activate method. Learn how to do it for Flutter.
productNotFound22This error indicates that the product requested for purchase is not available in the store.
invalidJson23The paywall JSON is not valid. Fix it in the Adapty Dashboard. Refer to the Customize paywall with remote config topic for details on how to fix it.
currentSubscriptionToUpdateNotFoundInHistory24The original subscription that needs to be renewed is not found.
pendingPurchase25This error indicates that the purchase state is pending rather than purchased. Refer to the Handling pending transactions page in the Android Developer docs for details.
billingServiceTimeout97This error indicates that the request has reached the maximum timeout before Google Play can respond. This could be caused, for example, by a delay in the execution of the action requested by the Play Billing Library call.
featureNotSupported98The requested feature is not supported by the Play Store on the current device.
billingServiceDisconnected99This fatal error indicates that the client app’s connection to the Google Play Store service via the BillingClient has been severed.
billingServiceUnavailable102This transient error indicates the Google Play Billing service is currently unavailable. In most cases, this means there is a network connection issue anywhere between the client device and Google Play Billing services.
billingUnavailable103

This error indicates that a user billing error occurred during the purchase process. Examples of when this can occur include:

1. The Play Store app on the user's device is out of date.

2. The user is in an unsupported country.

3. The user is an enterprise user, and their enterprise admin has disabled users from making purchases.

4. Google Play is unable to charge the user’s payment method. For example, the user's credit card might have expired.

5. The user is not logged into the Play Store app.

developerError105This is a fatal error that indicates you're improperly using an API.
billingError106This is a fatal error that indicates an internal problem with Google Play itself.
itemAlreadyOwned107The consumable product has already been purchased.
itemNotOwned108This error indicates that the requested action on the item failed sin

Custom StoreKit codes

ErrorCodeSolution
noProductIDsFound1000

This error indicates that none of the products you requested on the paywall are available for purchase in the App Store, even though they’re listed there. This error may sometimes come with an InvalidProductIdentifiers warning. If the warning appears without an error, ignore it.

If you’re encountering this error, follow the steps in the Fix for Code-1000 noProductIDsFound error section.

noProductsFound1001This error indicates that the product requested for purchase is not available in the store.
productRequestFailed1002Unable to fetch available products at the moment.
cantMakePayments1003In-app purchases are not allowed on this device. See the troubleshooting guide.
noPurchasesToRestore1004This error indicates that the App Store did not find the purchase to restore.
cantReadReceipt1005

There is no valid receipt available on the device. This can be an issue during sandbox testing.

In the sandbox, you won't have a valid receipt file until you actually make a purchase, so make sure you do one before accessing it. During sandbox testing also make sure you signed in on a device with a valid Apple sandbox account.

productPurchaseFailed1006Product purchase failed. The StoreKit error unrelated to Adapty. Try using a new sandbox profile. If it doesn't help, contact the Apple support.
missingOfferSigningParams1007

This error indicates issues with Adapty integration or with offers.

Refer to the Configure App Store integration and to Offers for details on how to set them up.

refreshReceiptFailed1010This error indicates that the receipt was not received. Applicable to StoreKit 1 only.
receiveRestoredTransactionsFailed1011Purchase restoration failed.

Custom network codes

ErrorCodeSolution
notActivated2002The Adapty SDK is not activated. You need to properly configure Adapty SDK using the Adapty.activate method.
badRequest2003Bad request.
Ensure you've completed all the steps required to integrate with the App Store.
serverError2004Server error.
Try again after some time. If the issue is not resolved, contact the Adapty support team.
networkFailed2005The error indicates issues with the network connection on the user's device.
Try disabling VPN or switching to WiFi from a cellular network or vice versa.
decodingFailed2006This error indicates that response decoding failed.
Review your code and ensure that you the parameters you send are valid. For example, this error can indicate that you're using an invalid API key.
encodingFailed2009This error indicates that request encoding failed.
analyticsDisabled3000We can't handle analytics events, since you've opted it out.
wrongParam3001This error indicates that some of your parameters are not correct.
If you're using the Adapty paywall builder and can't display a paywall because of this error, toggle on Show on device in the paywall builder.
Another possible reason for this issue is that the local fallback file version doesn't match the SDK version. Download a new file in the dashboard.
activateOnceError3005It is not possible to call .activate method more than once.
profileWasChanged3006The user profile was changed during the operation.
This error can occur when you call identify, and then call another method before identify succeds. To avoid it, wait untill identify suceeds before calling other methods.
unsupportedData3007This error indicates that the data format is not supported by the SDK.
persistingDataError3100It was an error while saving data.
fetchTimeoutError3101This error indicates that the fetch operation timed out.

Other issues

If you haven't found a solution yet, the next steps can be:

  • Upgrading the SDK to the latest version: We always recommend upgrading to the latest SDK versions since they are more stable and include fixes for known issues.
  • Contact the support team via [email protected] or via the chat: If you are not ready to upgrade the SDK or it didn't help, contact our support team. Note that your issue will be resolved faster if you enable verbose logging and share logs with the team. You can also attach relevant code snippets.