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

Crash on Release Build v4.0.0 && v.4.1.0 java.lang.NoSuchMethodError: No static method startTimedMetric #527

Open
jayjah opened this issue Nov 11, 2024 · 5 comments
Labels
Tap to Pay Issues with the Stripe Tap to Pay localmobile reader

Comments

@jayjah
Copy link

jayjah commented Nov 11, 2024

Summary

A crash is happening during a payment process only in release builds. This happens when TapToPay with v.4.0.0 is chosen.
Following stacktrace is visible:

                                                                                                    com.stripe.stripeterminal.external.models.TerminalException: Contactless transaction failed java.lang.IllegalStateException: App Error: SERVER_ERROR 'An unknown error has occurred: java.lang.NoSuchMethodError: No static method startTimedMetric$default(Lcom/stripe/loggingmodels/MetricLogger;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/util/List;ILjava/lang/Object;)Lcom/stripe/loggingmodels/Metric; in class Lcom/stripe/loggingmodels/MetricLogger; or its super classes (declaration of 'com.stripe.loggingmodels.MetricLogger' appears in /data/app/~~NKqak6cvB6gmZPkFmW_D1Q==/com.talex.mytaxidriver-q0DWEjoMpm8lAqPi0eu6Zw==/base.apk)'.
                                                                                                    	at com.stripe.stripeterminal.internal.common.adapter.CotsAdapter.callAidlWithExceptionConverted(CotsAdapter.kt:715)
                                                                                                    	at com.stripe.stripeterminal.internal.common.adapter.CotsAdapter.onReaderActivated(CotsAdapter.kt:467)
                                                                                                    	at com.stripe.stripeterminal.internal.common.adapter.ProxyAdapter.onReaderActivated(ProxyAdapter.kt:102)
                                                                                                    	at com.stripe.stripeterminal.internal.common.terminalsession.TerminalSession.activateReader$terminalsession_release(TerminalSession.kt:611)
                                                                                                    	at com.stripe.stripeterminal.internal.common.terminalsession.TerminalSession$ConnectReaderOperation.execute(TerminalSession.kt:2182)
                                                                                                    	at com.stripe.stripeterminal.internal.common.terminalsession.TerminalSession$ExternalOperation.run$terminalsession_release(TerminalSession.kt:1243)
                                                                                                    	at com.stripe.stripeterminal.internal.common.terminalsession.TerminalSession.enqueueOperation$lambda$6(TerminalSession.kt:1050)
                                                                                                    	at com.stripe.stripeterminal.internal.common.terminalsession.TerminalSession.$r8$lambda$9_FdDGpM1BaifeFRjKBBfCCLP6o(Unknown Source:0)
                                                                                                    	at com.stripe.stripeterminal.internal.common.terminalsession.TerminalSession$$ExternalSyntheticLambda0.run(D8$$SyntheticClass:0)

Code to reproduce

Android version

Android 14

Impacted devices

Google Pixel 7a

Dependency Versions

    // stripe
    implementation "com.stripe:stripe-java:26.4.0"
    implementation "com.stripe:stripeterminal:4.0.0"
    implementation "com.stripe:stripeterminal-taptopay:4.0.0"
    implementation "com.stripe:stripeterminal-core:4.0.0"
@sidhant-stripe
Copy link
Collaborator

sidhant-stripe commented Nov 11, 2024

Hi @jayjah

According to our documentation, you should replace implementation "com.stripe:stripeterminal:4.0.0" with

    implementation "com.stripe:stripeterminal-taptopay:4.0.0"
    implementation "com.stripe:stripeterminal-core:4.0.0"

Can you try removing the line implementation "com.stripe:stripeterminal:4.0.0" and let us know if this issue is still occurring?

Also, since this is only occurring in release builds, it seems like there might be a minification issue too. Can you provide any further details on your release build setup? Are you using proguard/dexguard?

If the above fix doesn't work, try adding the following to your proguard config:

-keep class com.stripe.** { *; }
-dontwarn com.stripe.**

@jayjah
Copy link
Author

jayjah commented Nov 12, 2024

Hi @sidhant-stripe, thank you for your response!

Unfortunately it's not possible for us to remove implementation "com.stripe:stripeterminal:4.0.0", because we use tap to pay and a bluetooth scanner from stripe within the same application.

Furthermore our proguard config already includes those lines.

Just for clarification:
This error does NOT happened with version 3.8.0 which was our last version where everything went fine.

@sidhant-stripe
Copy link
Collaborator

hi @jayjah, I've checked internally and confirmed that you do not need to include the stripeterminal dependency if you're including stripeterminal-core. Will continue to investigate, but in the meantime can you remove that line and see if you're still getting the same error?

A serial number for the device, account ID and approximate date/time when you encountered this issue would also be helpful if you can provide them.

@jayjah
Copy link
Author

jayjah commented Nov 18, 2024

@sidhant-stripe Unfortunately the same error occurs when I remove stripeterminal as a dependency.

Sure, here are all information you asked for:

Device ID: 89033023427100000000027390897104
Monday, 18. November 08:35-08:37 (GMT+1)

I'll provide the account ID as soon as I got it from my co-worker.

@xiaoshen-stripe xiaoshen-stripe added the Tap to Pay Issues with the Stripe Tap to Pay localmobile reader label Nov 21, 2024
@jayjah
Copy link
Author

jayjah commented Dec 10, 2024

@sidhant-stripe Unfortunately the same error happened with version 4.1.0 and com.stripe:stripe-java:28.1.0.

Current stripe dependencies looks like the following:

    // stripe
    implementation "com.stripe:stripe-java:28.1.0"
    //implementation "com.stripe:stripeterminal:4.0.0"
    implementation "com.stripe:stripeterminal-taptopay:4.1.0"
    implementation "com.stripe:stripeterminal-core:4.1.0"

@jayjah jayjah changed the title Crash on Release Build v4.0.0 java.lang.NoSuchMethodError: No static method startTimedMetric Crash on Release Build v4.0.0 && v.4.1.0 java.lang.NoSuchMethodError: No static method startTimedMetric Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Tap to Pay Issues with the Stripe Tap to Pay localmobile reader
Projects
None yet
Development

No branches or pull requests

3 participants