Troubleshooting
Error codes, architecture notes, and version compatibility for the React Native SDK
Troubleshooting
Error handling
onError(error, component) receives every terminal failure, including the shopper closing the sheet. Branch on error.errorCode and always dismiss the UI:
import { ErrorCode } from '@plexy/react-native';
const onError = useCallback((error, component) => {
component.hide(false);
switch (error.errorCode) {
case ErrorCode.canceled:
// Shopper closed the payment sheet — not a failure, no alert needed
break;
case ErrorCode.sessionError:
// Session could not be created — check the session data from your backend
break;
default:
showPaymentFailedMessage(error.message);
}
}, []);Error codes
| Code | Meaning |
|---|---|
canceledByShopper | The shopper cancelled the payment. Treat as a normal outcome. |
notSupported | Payment method not supported on the current platform. |
notSupportedAction | This component does not support action handling. |
noClientKey | No clientKey in the configuration. |
noPayment | Missing or invalid amount / countryCode in the configuration. |
invalidPaymentMethods | The paymentMethods response could not be parsed or is empty. |
invalidAction | The action object could not be parsed. |
noPaymentMethod | The type passed to start() is not in the provided payment methods list. |
sessionError | The session could not be created. |
For declined payments (as opposed to SDK errors), see Refusal reasons and Result codes.
Common issues
The app crashes with a missing native module
The JavaScript package is installed but the native side is not linked:
- Bare React Native: run
cd ios && pod install, then rebuild the app (a Metro reload is not enough). - Expo: make sure the plugin is in
app.jsonand re-runnpx expo prebuild --clean. - The SDK does not work in Expo Go — use a development build.
Redirect payment methods never return to the app
The shopper completes 3D Secure or a bank redirect in the browser, but your app never resumes:
- iOS: verify the
RedirectComponent.applicationDidOpenhandler is inAppDelegate.swiftand runs beforeRCTLinkingManager. Verify your URL scheme is registered. - Android: verify the
intent-filteron your checkout activity and thePlexyCheckout.handleIntent(intent)call inonNewIntent. - Check that
returnUrlin your configuration (and in your/sessionsor/paymentsrequest) matches the registered scheme exactly.
Android build fails with a theme error
The native payment UI requires a Material Components theme. Make sure your app theme extends Theme.MaterialComponents (see Android setup).
Callbacks fire multiple times or not at all
Wrap every callback passed to <PlexyCheckout> in useCallback. Inline functions cause listener re-registration on each render and can drop or duplicate events.
New Architecture
The React Native New Architecture is supported on React Native 0.76.0 and above only. On older versions either:
- keep using the Old Architecture, or
- disable bridgeless mode with
load(bridgelessEnabled = false).
Older React Native versions
React Native 0.74+ works out of the box. Older versions need manual adjustments:
React Native 0.73
- Set
kotlinto at least 1.9.10 innode_modules/@react-native/gradle-plugin/gradle/libs.versions.toml. - Set
apiVersionto at least 1.7 innode_modules/@react-native/gradle-plugin/build.gradle.kts.
React Native 0.72 and below
- Use Java 17.
- Update
compileTargetto 34 inandroid/build.gradle. - Set
classpath("com.android.tools.build:gradle:8.1.4")inandroid/build.gradle. - Enable
buildConfiginandroid/app/build.gradle:android.buildFeatures.buildConfig = true.
Google's Play Store target API requirements make React Native 0.73 and below effectively deprecated for new submissions. Upgrade if you can.
Debug logging
Turn on verbose SDK logs while investigating an issue:
const configuration: Configuration = {
// ...
analytics: { verboseLogs: true },
};Then check Xcode's console or adb logcat for the native-side output.
Still stuck?
- Error codes reference for API-level errors
- HTTP status codes if your backend calls fail before the SDK is involved