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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悰 android builds on @stripe/stripe-react-native >= 0.23.1 now require kotlin >= 1.8 #1294

Closed
walkerdb opened this issue Feb 10, 2023 · 2 comments

Comments

@walkerdb
Copy link
Contributor

walkerdb commented Feb 10, 2023

Normally this wouldn't be an issue but there seems to be a bit of a community cross-compatibility issue going on at the moment.

All versions starting at 0.23.1 show compilation failures like the below during app builds when using kotlin < 1.8:

Class 'com.stripe.android.PaymentAuthConfig.Stripe3ds2UiCustomization' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.

there are hundreds of these errors, presumably one for each class.

In a world free of dependency entropy we'd just update our kotlin version and move on, however like many folks using stripe we also rely on react-native-plaid-link-sdk, which fails to compile when run on kotlin 1.8 due to their use of a legacy kotlin plugin.

I'd report the problem there but they turned off their issues tab lol. I'll cc @wkiefer anyway just in case, since they're the most recent contributor there.

Is there any way that compilation under kotlin 1.6 could be supported? In the meantime to maintain plaid support we're likely going to have to pin stripe to 0.23.0.

If kotlin 1.8 is actually a new hard requirement it might be useful to update the readme to reflect it, since it's currently undocumented.

@charliecruzan-stripe
Copy link
Collaborator

charliecruzan-stripe commented Feb 10, 2023

hey @walkerdb ! So stripe-android bumped their kotlin version to 1.8.0, and that was bumped in a patch release so we automatically pull in that version as of 0.23.1 (which is why you're seeing this behavior).

You can override the version of stripe-android your app uses. In your android/build.gradle file, you can override the version of stripe-android with:

buildscript {
    ext {
        stripeVersion = "20.19.1" // This is the version BEFORE the kotlin bump
    }
}

However, this will only work up to version of 0.23.2 of this library, since in 0.23.3, we begin to rely on features from the newer version of the stripe-android SDK (so you'll get compilation errors if you try to build with an older version of stripe-android). Plus, {all the usual caveats about overriding transitive dependency versions}.

Regarding the plaid link SDK, I'm not too familiar with it, but you might want to check out the Financial Connections features we've released over the past couple months in this library. It might be what you're looking for, and you're already installing it as part of this SDK: here's the overview docs page and here's the page on some specific RN SDK functions

@charliecruzan-stripe
Copy link
Collaborator

Closing this since it's not a bug- the best workaround is mentioned above: pinning the version of stripe-android. However, to use past v 0.23.2 of this library, you'll need to upgrade your kotlin version

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

2 participants