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

Add dagger to stripe-ui-core to prevent duplicate class issue. #6602

Merged
merged 2 commits into from
Apr 26, 2023

Conversation

jaynewstrom-stripe
Copy link
Collaborator

@jaynewstrom-stripe jaynewstrom-stripe commented Apr 26, 2023

Summary

Dagger generates a factory class com.stripe.android.uicore.address.AddressRepository_Factory when the compiler runs over classes with @Inject constructors. If the dagger compiler doesn't run in a module, downstream modules will generate the factory so the class can be instantiated. In our case, 2 modules were generating the same class because the upstream module wasn't generating the factory. This led to duplicate class issues when both modules were included in a merchant application.

Motivation

#6590

Testing

  • Added tests
  • Modified tests
  • Manually verified

Ideally we have a sample that integrates ALL of our SDKs, and that would have caught this issue before a user reported it.

I manually verified this fix by including identity in the paymentsheet-example project (and also removing card scan).

@jaynewstrom-stripe jaynewstrom-stripe marked this pull request as ready for review April 26, 2023 15:40
@jaynewstrom-stripe jaynewstrom-stripe requested review from a team as code owners April 26, 2023 15:40
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

Successfully merging this pull request may close these issues.

3 participants