Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] Contactless transaction failed com.stripe.core.aidIrpc.AidIRpcException: Failed to send request to AIDL server. #809

Open
nabilfreeman opened this issue Sep 12, 2024 · 8 comments
Assignees

Comments

@nabilfreeman
Copy link

nabilfreeman commented Sep 12, 2024

Describe the bug
See the attached photo. Repeatably on Android, after calling collectPaymentMethod to present the Tap to Pay card reader, the reader screen dismisses and this error in thrown. The full text in the alert body is the entirety of the error message:

Contactless transaction failed com.stripe.core.aidIrpc.AidIRpcException: Failed to send request to AIDL server.

It appears this issue was introduced after updating from targetSdkVersion & compileSdkVersion 33 to 34.

It is still possible to take a contactless payment on Android, so this appears to be intermittent.

My best guess is that this is related to card read errors ("Try again" and loud beep on Android). After two or three of these, the sheet closes and the error is triggered.

In general, it seems that the Android tap to pay reader is very unreliable, and the user has to endure several "Try again" errors before successfully processing the payment. This was the case before updating the targetSdkVersion, so I am not sure if it is related.

To Reproduce
Steps to reproduce the behavior:

  1. Trigger collectPaymentMethod({ paymentIntent })
  2. Observe payment sheet appears
  3. Tap a payment card in the indicated location
  4. Observe either a successful payment (if so, restart the steps here), or a loud beep and "Try again" error
  5. After 2-3 "Try again" errors, observe the payment sheet dismisses and collectPaymentMethod promise rejects with the error message in the issue title.

Expected behavior

  • Primarily, the payment sheet remains active correctly for both successful and unsuccessful card reads
  • Secondarily, the tap to pay reader is more reliable in reading the card successfully for the first time

Screenshots

IMG_6399

Stripe Terminal React Native SDK version

  • ^0.0.1-beta.19

Smartphone (please complete the following information):

  • Device: Google Pixel 6a
  • OS: Android 14

Additional context

In Expo app.json plugins:

[
				"expo-build-properties",
				{
					"android": {
						"targetSdkVersion": 34,
						"compileSdkVersion": 34,
						"minSdkVersion": 26,
						"buildToolsVersion": "34.0.0",
						"packagingOptions": {
							"exclude": [
								"org/bouncycastle/x509/CertPathReviewerMessages*"
							]
						}
					}
				}
]
@nabilfreeman
Copy link
Author

nabilfreeman commented Sep 12, 2024

Update: I have now updated to the latest version of the terminal SDK, beta 20, which is backed by Android SDK 3.7.1.

The issue is still easily repeatable.

Here is a serial number if you want to internally investigate this:

3f80cfc2-2753-4560-b481-6553b8373326

I might be able to sort out an APK for you to test as well, please feel free to get in touch as we are particularly concerned about this one.

@nabilfreeman
Copy link
Author

Update: This is still happening. Here is a video demonstrating the error occurring after a card read failure.

https://www.youtube.com/watch?v=t9nXQoPK6nY

I've been in touch with a few people from Stripe today on the developer Discord. Here's the threads:

https://discord.com/channels/841573134531821608/1285245446662393918

https://discord.com/channels/841573134531821608/1285272503220043839

Unfortunately we didn't get to a solution.

As I mentioned in the threads, this is a regression that is blocking us from shipping updates to the Google Play store. We can't downgrade back to an older version of the Terminal SDK without this problem because of the requirement for new updates to target targetSdkVersion 34.

We are really stuck here, please help!

@nabilfreeman nabilfreeman changed the title Contactless transaction failed com.stripe.core.aidIrpc.AidIRpcException: Failed to send request to AIDL server. [bug] Contactless transaction failed com.stripe.core.aidIrpc.AidIRpcException: Failed to send request to AIDL server. Sep 16, 2024
@nazli-stripe nazli-stripe self-assigned this Sep 16, 2024
@nazli-stripe
Copy link
Collaborator

hey @nabilfreeman thanks for reporting this issue. We are internally looking into this and will update once we know more or if we need more information.

@nabilfreeman
Copy link
Author

Thank you @nazli-stripe ! I am at hand to provide any information & try stuff for you if you need. Please feel free to write here or contact me via the email on our Stripe Account

@mindy-stripe
Copy link
Collaborator

Hi @nabilfreeman - we're looking into this and wanted to eliminate the possibility of this being a device memory issue. Could you please try the following:

  • Restart your device and close all other apps.
  • If possible, try the same operation on a device with more RAM (like a Pixel 7 or 7 Pro).
  • Before initiating the payment collection, check the device's memory usage (Settings > Developer Options > Memory).

Additionally, if you have access to another Android device, it would be helpful if you could test the app there as well. This will help us determine if the issue is device-specific or more general.

If you're able to reproduce, can you please provide device UUIDs + PaymentIntent IDs as well?
Thanks in advance!

@nabilfreeman
Copy link
Author

nabilfreeman commented Sep 18, 2024

Hi @mindy-stripe, thank you very much to you and your team for picking this up.

Memory readings

I can only see average memory usage from the last 3 hours in the Android settings - screenshot at the end of this post.

So to provide you with some more data, I used adb shell "cat /proc/meminfo" to take more granular readings.

This is on a Pixel 6a with nothing else running, completely stock (it is a developer phone, so there is essentially nothing installed on it). It has 6GB of RAM.

Immediately after cold boot

MemTotal:        5738468 kB
MemFree:           69536 kB
MemAvailable:    1011820 kB

Upon launching our app

MemTotal:        5738468 kB
MemFree:          220980 kB
MemAvailable:    1267532 kB

Upon opening the "Payment" screen (where the Tap to Pay button is rendered)

MemTotal:        5738468 kB
MemFree:          109944 kB
MemAvailable:    1204132 kB

Card reader screen open (no card read yet)

MemTotal:        5738468 kB
MemFree:           95384 kB
MemAvailable:    1217332 kB

At this point even without reading the card the screen automatically dismissed, we got the "JENA keeps stopping" alert and the "Contactless transaction failed" error, and I took another memory reading.

MemTotal:        5738468 kB
MemFree:          130740 kB
MemAvailable:    1181460 kB

Card reader screen open (after failed card read)

MemTotal:        5738468 kB
MemFree:          148732 kB
MemAvailable:    1309992 kB

I am not experienced enough with Android memory management to offer an opinion on what these values could mean. The MemFree appears to be very low, while MemAvailable is consistently over 1GB. This Stack Overflow comment is as far as I looked to understand that.

Additional observations

While gathering the above data I observed a couple of instances of the "Failed to send request to AIDS server" throwing before the payment sheet opened.

Another device

Will try and gain access to another Android device with higher specs as soon as possible, and try to replicate the steps and issues recorded in the video I shared in the previous comment.

I hope this information helps. Please let me know if you need anything else.

IMG_6440

@nabilfreeman
Copy link
Author

Hi @mindy-stripe, do you have an update here?

This is easily repeatable every day in production still. We are now considering pulling the feature due to its unreliability.

@nazli-stripe
Copy link
Collaborator

nazli-stripe commented Oct 3, 2024

hey @nabilfreeman thanks for your patience. One thing the team noted is that it appears the app connects and disconnects from TTP reader for every transaction. Spinning up the TTP process like this for every transaction could cause memort management issues. Is there a need to connect per transaction and disconnect when done?

For the card read, the purple tap icon is positioned exactly where you should tap the card. In the video it looks like you are tapping slightly above that. Tapping right behind the icon might help with the inconsistencies there

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants