Troubleshooting
Common issues and solutions when integrating the EdfaPay Soft POS.
Overview
This guide covers common integration issues organized by category. For each issue, we provide the symptoms, cause, and solution.
Build
Build issues
Runtime
Runtime issues
NFC
NFC issues
Transactions
Transaction issues
Build Issues
Repository Access Denied (401)
Gradle sync fails with "401 Unauthorized" accessing the EdfaPay Maven repository. Cause: The EdfaPay Maven repository requires authenticated access. Gradle cannot download the SDK artifact because the account is missing or mistyped, or the repository is declared in a file Gradle ignores. Check 1 — The username and password match the Installation page (Step 2) exactly. They are EdfaPay's public read-only account for downloading the SDK, the same for every integrator, not the SDK credentials you pass to initiate(). Check 2 — The repository is where your project reads it: settings.gradle(.kts) for native Android; for Flutter, the allprojects block in android/build.gradle(.kts) (Installation, Step 2).
META-INF Duplicate Files
Build error: "2 files found with path 'META-INF/DEPENDENCIES'" Cause: Multiple libraries bundle identical META-INF files, and Gradle's default behavior is to fail on duplicates. Solution: Add packaging exclusions to your app-level build.gradle.kts:
Loading...Incompatible Gradle Version
Build failure with Gradle compatibility errors. Solution: Use Gradle 8.11.1+ with AGP 8.9.1+ (AGP 8.9 requires Gradle 8.11.1 or newer):
Loading...SDK Version / compileSdk Mismatch
Build warning or error about target SDK version mismatch. Solution: Use compileSdk 36 or higher with minSdk 29:
Loading...ProGuard/R8 Stripping Classes
Runtime crashes after enabling ProGuard/R8 in release builds. Solution: Add EdfaPay keep rules to your proguard-rules.pro:
Loading...minSdk Version Too Low
Below minSdk 28 the build stops at the manifest merge: a library the SDK uses declares minSdk 28. With minSdk 28 the build succeeds, but on Android 9 initiate() with a token ends in onError with "App is running on unsupported sdk version of device" (code 1006). Solution: Set minSdk to 29 (Android 10) in your app-level build.gradle.kts:
Loading...Runtime Issues
SDK Initialization Fails
EdfaPayPlugin.initiate() calls onError callback immediately. Common causes: • Invalid or expired auth token • No internet connectivity at initialization time • Token from another environment: a token works only in the environment that issued it (Env.DEMO for integration and testing, Env.PRODUCTION for live payments) Solution: Verify credentials, check network connectivity, and ensure correct environment is selected.
FragmentActivity Required
Kotlin and Java: compile error (type mismatch) when you pass your Activity to initiate() or a payment function, because they take a FragmentActivity. Flutter: the app stops at start with IllegalStateException "Use FlutterFragmentActivity instead of FlutterActivity in your MainActivity". React Native: the first SDK call fails with IllegalStateException "EdfapaySoftposSdkRn: Activity must be a FragmentActivity. Use FragmentActivity or AppCompatActivity as your MainActivity base class." Solution: Your Activity must extend AppCompatActivity (or FragmentActivity):
Loading...Session Expired Errors
onError after the SDK was previously working, with a message such as "Session expired and non renewable, Initialize the SDK again", "EdfaPay session has expired and cannot be renewed. Please initialize the SDK again." or "Session not exist to renew, Please initialize the SDK first". The full list of session messages is under Common Errors on the Error Handling page. Cause: SDK sessions expire after a period of inactivity or when the server invalidates them. Solution: Re-initialize the SDK when session expires, with all three callbacks:
Loading...NFC Issues
Card Not Reading Properly
Card tap detected but reading fails or times out. Common causes: • Card removed too quickly (less than 2 seconds) • Card not positioned over NFC antenna • Interference from phone case or other cards • Damaged NFC chip on card Solution: Guide user to hold card flat for at least 2 seconds at the NFC antenna location.
Finding NFC Antenna Position
NFC antenna position varies by device model. Generally: • Most Android devices: center or upper-back area • Samsung: back center • Google Pixel: back center/upper • Xiaomi/OPPO/Vivo: back center Tip: Use an NFC-enabled app to locate the exact antenna position on a specific device model.
Transaction Issues
Transaction Always Declined
All transactions return decline response. Common causes: • Terminal not properly configured on EdfaPay server • Missing required TXN parameters Solution: Verify you are using the correct environment (Env.DEMO for testing). DEMO accepts real cards and never charges them.
On docs.edfapay.com
Issuer decline reasons: Transaction decline codes. These are the card issuer's 2-digit codes; the SDK's own error codes are a separate list (see Error Handling).
onPaymentProcessComplete Called Several Times or Not at All
The callback fires more than once for one payment, or never. Cause: onPaymentProcessComplete is called once per flow stage, so more than once with FlowType.STATUS and FlowType.DETAIL (see Flow Types on the Payment Operations page); isFlowComplete is true on the call that completes the flow. When it never fires, the flow ended in another callback: onCardScanTimerEnd (no card was tapped in time), onCancelByUser (the user closed the card screen), onRequestTimerEnd (the server did not answer in time) or onError. Solution: Gate your logic on isFlowComplete being true, and handle the other four callbacks.
Duplicate Transaction Prevention
Concern about duplicate charges if app crashes mid-transaction. Solution: Use the transaction RRN (Retrieval Reference Number) returned in onPaymentProcessComplete to check for existing transactions before initiating a new one. The SDK does not automatically prevent duplicates at the application level.
Reversal Returns an Error
reverseLastTransaction() ends in onError. Cause: It reverses only the last card transaction the SDK stored, and only if that is a purchase that finished less than 60 seconds ago. Otherwise onError receives a message such as "Transaction reversal window (60 seconds) has expired." or "Transaction already reversed". If the operation is not enabled for your terminal, the onError message names the feature. Solution: Call reverseLastTransaction() right after the purchase. To cancel an older payment, use refund() (see Payment Operations).
Debugging Tips
Enable verbose logging to diagnose issues quickly.
On docs.edfapay.com
SDK errors reported to EdfaPay, by SDK version, are in the dashboard: Logs.
Loading...Test Devices Only
Logs may contain sensitive data. Turn on enableLogs only on test devices, never in builds you share.
On this page
Downloads
Coming SoonSample apps, release bundles, and more content will be available here soon.