Add dagger to stripe-ui-core to prevent duplicate class issue. #6602
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
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).