Skip to main content
Primer Checkout React Native SDK is currently in beta (v3.0.0-beta.1). The API is subject to change before the stable release.
This page covers installing, building and setting up the SDK. For problems while the checkout runs, such as a checkout that never becomes ready, see Troubleshooting for React Native.

Installation issues

Importing the package fails with “‘NativePrimer’ could not be found”

Problem: The app throws as soon as it imports @primer-io/react-native, with an error that 'NativePrimer' could not be found. Cause: The app binary doesn’t contain the SDK’s native code. The package loads its native module on import, so the error appears before any checkout code runs. Solution:
  1. On iOS, run pod install in your app’s ios folder.
  2. Rebuild and reinstall the app on each platform. Reloading the JavaScript bundle doesn’t add native code.

pod install fails on PrimerSDK

Problem: pod install reports a version conflict on PrimerSDK, or can’t find the PrimerSDK version the package needs. Solution: The package’s .podspec file pins an exact PrimerSDK version. Remove any pod 'PrimerSDK' line with another version from your Podfile, for example one left over from a 2.x integration. If CocoaPods can’t find the pinned version, update your local spec repository:
See Installation for the versions this release uses.

Android build fails with Unresolved reference errors

Problem: The Android build fails while compiling the SDK’s native module, with Unresolved reference errors on Primer classes. Cause: The package needs io.primer:android, io.primer:components-analytics and io.primer:components-bridge at the one version it pins. If your app adds one of them or forces another version, the three no longer match. Solution: Remove these artifacts from your app’s build.gradle and any dependency resolution rule that changes their version. The package brings them.

Gradle can’t resolve Klarna’s Android SDK

Problem: After you add io.primer:klarna-android, Gradle can’t resolve Klarna’s dependencies. Solution: Klarna’s Android SDK is served from Klarna’s own Maven repository. Add it to the repositories block in android/app/build.gradle, as shown in Native setup.

Native setup issues

These problems appear in the payment method list or when a payment method starts, but the fix is in your native project or your settings. For each setup step, see Native setup.

3DS challenge not completing

Problem: A payment gets stuck during 3D Secure authentication. Solution: The native SDK runs the challenge. Check that Primer3DS is installed on iOS and io.primer:3ds-android on Android, as shown in Native setup. The 3D Secure SDK’s security checks fail on debug builds and emulators: during development, turn them off with debugOptions: { is3DSSanityCheckEnabled: false }, and never ship that setting. Keep PrimerCheckoutProvider mounted while the challenge is on screen. Unmounting it removes its listeners, so your app no longer receives the payment’s result. A challenge that fails arrives like any other failed payment: in onError and as a paymentOutcome with status: 'error'.

Getting help

If your issue isn’t covered here, contact Primer support and include:
  1. The @primer-io/react-native version from your package.json, and the platform and OS version.
  2. The error’s errorId and description.
  3. The error’s diagnosticsId, when it’s set.
Never include card numbers, expiry dates or security codes in logs, screenshots or support requests.

See also

Installation

Install the package and the iOS pods

Native setup

URL schemes, wallets and optional native dependencies

Runtime troubleshooting

Problems while the checkout runs

PrimerError

Error fields and the error IDs the SDK raises