stripe-android: The 3ds2 dependency breaks Firebase Performance and Robolectric
Summary
Upgrading Stripe to version 9.3.5 (or any version after 9.1.1) breaks our app. The 3ds2 dependency added transitively the dependency to org.bouncycastle:bcprov-jdk15on:1.61. This forces a few other dependency to use that version and breaks the app in different ways:
- The Firebase performance plugin (version 1.1.5) fails to load with the following error:
/.../app/build/intermediates/transforms/FirebasePerformancePlugin/release/162/module-info.class: D8: Unsupported source file type
- The robolectric (version 4.0.2) tests take a very long time to run (~15 minutes per test)

Android version
minSdk 21
SDK version
Version 9.1.1 to 9.3.5
Other information
I managed to work around both issues by forcing the bouncy castle dependency to 1.52. Forcing the version to 1.52 shows an issue with Lint:
Invalid package reference in library; not included in Android: javax.naming.directory. Referenced from org.bouncycastle.jce.provider.X509LDAPCertStoreSpi.
But I imagine we can safely ignore it as I don’t assume we do LDAP with Stripe.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 2
- Comments: 47
Yes I am using a similar fix:
The tricky bit with this issue is that it’s not really a bug on Stripe nor a bug on Firebase (or bouncy castle). But rather the three parts not playing well together.
I’ve confirmed that adding the following to our top-level build.gradle does fix the problem by forcing a bouncycastle downgrade. It’s ugly, but that may be our best path forward until someone finds a real fix for the root issue.
@RomainPiel I just released 10.0.1 which fixes some of the incompatibilities with the Firebase plugin. Can you let me know if it resolves your issues?
@RomainPiel can you DM me in ASG?