stripe-terminal-android icon indicating copy to clipboard operation
stripe-terminal-android copied to clipboard

Tap To Pay Connection Issues

Open chris-oswald opened this issue 4 months ago • 6 comments

Summary

I'm getting this crash when I'm trying to discover my Tap to Pay reader. It's in the guts of stripe and I'm stumped what's wrong. I'm sure it's something I'm doing. The bluetooth reader connection works perfect.

I have the correct permissions requested and granted (double checked)

I've included the logs below.

Code to reproduce

        var configuration = new TapToPayDiscoveryConfiguration(isSimulated: true);

        _listener = new ReaderDiscoveryListener(DiscoveryListener, AutoConnectReaderListener);

        _discoveryCancelable = Terminal.Instance.DiscoverReaders(configuration, _listener, new GenericCallback((ex) =>
        {
            System.Diagnostics.Debug.WriteLine("**** Discover Readers Callback *****" + ex?.ErrorMessage);

            if (ex != null)
                scanTimeoutCallback(ex.ErrorMessage);
        }));

Android version

Android Version 13

SDK version

4.6.0 - I've built the bindings in MAUI .Net 9

Other information

[0:] *** OnConnectionStatusChange DISCOVERING ***

[StripeTerminal] class=AdapterRepository message="Switching adapters" from=null to=CotsAdapter

[StripeTerminal] class=CotsAdapter message=onDisconnect unexpected=false

[StripeTerminal] class=AidlRpcClient message=bindToService action= packageName=com.stubs.StubsScannr className=com.stripe.cots.aidlservice.SimulatedCotsService

[StripeTerminal] class=AidlRpcClient message="Context::bindService completed" success=true

[StripeTerminal] class=AidlServiceConnection message=onBindingDied() connectionOwner=SimulatedCotsClient componentName=ComponentInfo{com.stubs.StubsScannr/com.stripe.cots.aidlservice.SimulatedCotsService}

chris-oswald avatar Aug 13 '25 02:08 chris-oswald

@chris-oswald what is the error and the observed behavior? I see the onBindingDied log line but it's unclear to me what's actually happening from your report.

maggiewhite-stripe avatar Aug 13 '25 05:08 maggiewhite-stripe

@maggiewhite-stripe - It shows a crash window, like the app is going to die, but never actually does. I'm able to keep using the app, but can't connect to Tap to Pay.

  • The discovering readers method never fires OnUpdateDiscoveredReaders
  • After 60 seconds it passes a handled exception in the DiscoverReaders callback saying "Contactless transaction failed com.stripe.core.aidlrpc.AidlRpcException: Service never connected."

I am able to use the Stripe Dashboard app and connect to my tap to pay reader tho. So I know it's not my device and likely something I'm doing.

chris-oswald avatar Aug 13 '25 12:08 chris-oswald

It's hard to say conclusively what the cause might be without having the error message at the point of reader connection, but we've had connection difficulties reported previously in #601 which stem from related issues dotnet/android#8675 and dotnet/android#10312.

If the logs indicate a similar error message around the time of attempting to connect to the reader, this is a known compatibility issue with MAUI and the Terminal SDK.

chr-stripe avatar Aug 13 '25 14:08 chr-stripe

Ok I actually think it's related to what you linked. I'm going to see if I can figure out how to fix it. Don't see that anyone has figured this out yet.

This looks to be what's crashing

:stripetaptopay No implementation found for void crc6488302ad6e9e4df1a.MauiApplication.n_onCreate() (tried Java_crc6488302ad6e9e4df1a_MauiApplication_n_1onCreate and Java_crc6488302ad6e9e4df1a_MauiApplication_n_1onCreate__) - is the library loaded, e.g. System.loadLibrary?

chris-oswald avatar Aug 13 '25 15:08 chris-oswald

@chris-oswald Can you confirm whether you've got a path forward?

mattlaroche-stripe avatar Oct 03 '25 19:10 mattlaroche-stripe

@mattlaroche-stripe - No, I'm stuck because of how Maui handles starting the Stripe process from within the application in Android. When the new Stripe process is created for the tap-to-pay, Maui also tries to spin up another version of the base Maui app, which causes it to crash. There seems to be no way to programmatically prevent the guts of Maui from trying to bootstrap itself again. MS doesn't seem to give a crap, as numerous other people are stuck on the same thing. The suggestions are to build a pure Java wrapper which seems to defeat the purpose of using Maui.....

I can get the simulated version of tap-to-pay to work. I'm assuming because it's not being started in a secure process.

chris-oswald avatar Oct 04 '25 15:10 chris-oswald