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

Incompatibility with OkHttp 5.0.0-alpha.14 in Stripe Terminal Android SDK #501

Closed
mehulrewardle opened this issue Sep 13, 2024 · 2 comments

Comments

@mehulrewardle
Copy link

mehulrewardle commented Sep 13, 2024

##Summary

When integrating the Stripe Terminal Android SDK (v3.9.1) with the AWS Amplify Framework (com.amplifyframework:aws-auth-cognito:2.18.0), which relies on okhttp 5.0.0-alpha.14, the application crashes due to a NoClassDefFoundError for okhttp3.internal.Util.

Code to reproduce

// Add Stripe Terminal SDK
implementation "com.stripe:stripeterminal:3.9.1"
implementation "com.stripe:stripeterminal-localmobile:3.9.1"

// Add AWS Amplify Cognito Auth (which uses OkHttp 5.0.0-alpha.14)
implementation('com.amplifyframework:aws-auth-cognito:2.18.0')

Steps:

Initialize the Stripe Terminal SDK using Terminal.initTerminal.
The app crashes with a NoClassDefFoundError.

Error log:

java.lang.NoClassDefFoundError: Failed resolution of: Lokhttp3/internal/Util;
at okhttp3.tls.HandshakeCertificates$Builder.build(HandshakeCertificates.kt:174)
at com.stripe.jvmcore.httptls.dagger.HttpTlsModule.provideHandshakeCertificates(HttpTlsModule.kt:19)
at com.stripe.jvmcore.httptls.dagger.HttpTlsModule_ProvideHandshakeCertificatesFactory.provideHandshakeCertificates(HttpTlsModule_ProvideHandshakeCertificatesFactory.java:48)
at com.stripe.jvmcore.httptls.dagger.HttpTlsModule_ProvideHandshakeCertificatesFactory.get(HttpTlsModule_ProvideHandshakeCertificatesFactory.java:39)
at com.stripe.jvmcore.httptls.dagger.HttpTlsModule_ProvideHandshakeCertificatesFactory.get(HttpTlsModule_ProvideHandshakeCertificatesFactory.java:14)
at com.stripe.jvmcore.client.dagger.HttpClientBaseModule_ProvideHttpClientFactory.get(HttpClientBaseModule_ProvideHttpClientFactory.java:56)
at com.stripe.jvmcore.client.dagger.HttpClientBaseModule_ProvideHttpClientFactory.get(HttpClientBaseModule_ProvideHttpClientFactory.java:17)
at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
at com.stripe.stripeterminal.dagger.LogModule_ProvideCrpcClientFactory.get(LogModule_ProvideCrpcClientFactory.java:63)
at com.stripe.stripeterminal.dagger.LogModule_ProvideCrpcClientFactory.get(LogModule_ProvideCrpcClientFactory.java:16)
at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
at com.stripe.stripeterminal.dagger.LogModule_ProvideClientLoggerApiFactory.get(LogModule_ProvideClientLoggerApiFactory.java:37)
at com.stripe.stripeterminal.dagger.LogModule_ProvideClientLoggerApiFactory.get(LogModule_ProvideClientLoggerApiFactory.java:13)
at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
at com.stripe.jvmcore.logging.terminal.log.DeviceRoleLogUploader_Factory.get(DeviceRoleLogUploader_Factory.java:45)
at com.stripe.jvmcore.logging.terminal.log.DeviceRoleLogUploader_Factory.get(DeviceRoleLogUploader_Factory.java:11)
at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
at com.stripe.stripeterminal.dagger.LogModule_ProvideLogUploaderFactory.get(LogModule_ProvideLogUploaderFactory.java:37)
at com.stripe.stripeterminal.dagger.LogModule_ProvideLogUploaderFactory.get(LogModule_ProvideLogUploaderFactory.java:13)
at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
at com.stripe.jvmcore.logging.terminal.dagger.JvmCoreLogModule_ProvideLogFlusher$logging_terminalFactory.get(JvmCoreLogModule_ProvideLogFlusher$logging_terminalFactory.java:47)
at com.stripe.jvmcore.logging.terminal.dagger.JvmCoreLogModule_ProvideLogFlusher$logging_terminalFactory.get(JvmCoreLogModule_ProvideLogFlusher$logging_terminalFactory.java:15)
at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
at com.stripe.stripeterminal.DaggerTerminalComponent$TerminalComponentImpl.getTraceFlusher(DaggerTerminalComponent.java:2510)
at com.stripe.stripeterminal.Terminal$Companion.initTerminal(Terminal.kt:1057)
at com.stripe.stripeterminal.Terminal$Companion.initTerminal(Terminal.kt:975)
at com.stripe.stripeterminal.Terminal.initTerminal(Unknown Source:2)

Android version

Tested on Android 11

Impacted devices (Android devices or readers)

Android device

SDK version

Stripe Terminal SDK version: 3.9.1
OkHttp version: 5.0.0-alpha.14 (forced due to AWS Amplify dependency)

Other information

Suggested Resolution:
Update the Stripe Terminal SDK to support OkHttp 5.x or provide a fallback mechanism for projects relying on newer OkHttp versions

@ugochukwu-stripe
Copy link
Contributor

ugochukwu-stripe commented Sep 17, 2024

Hi @mehulrewardle, thanks for reporting this; we currently do not have concrete timelines for when we'd integrate okhttp 5 in stripe terminal. Have you tried pulling in the okhttp-tls1 library from the same okhttp version as a work around? Stripe terminal relies on version 4.12 2, and the mismatch is most likely the root cause of this error.

Please let us know if the workaround resolves the issue for you; you'd also want to upgrade to the latest release 3.9.3 that resolves reported issues in 3.9.13 .

Footnotes

  1. com.squareup.okhttp3:okhttp-tls:5.0.0-alpha.14

  2. https://repo1.maven.org/maven2/com/stripe/stripeterminal-core/3.9.3/stripeterminal-core-3.9.3.pom

  3. https://github.com/stripe/stripe-terminal-android/blob/master/CHANGELOG.md#changelog

@dmatthews-stripe
Copy link
Collaborator

Hi @mehulrewardle , we will be closing this ticket out. Please feel free to re-open this ticket or create a new one if you are having any further issues.

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