Skip to content

fix(android): uses unique authorities for file provider#2306

Open
huextrat wants to merge 2 commits intostripe:masterfrom
huextrat:fix/android-unique-authorities
Open

fix(android): uses unique authorities for file provider#2306
huextrat wants to merge 2 commits intostripe:masterfrom
huextrat:fix/android-unique-authorities

Conversation

@huextrat
Copy link
Contributor

@huextrat huextrat commented Feb 16, 2026

Summary

  • Use a library-specific FileProvider subclass (StripeFileProvider) in the Android manifest instead of the generic androidx.core.content.FileProvider. Giving this library's provider a unique android:name prevents the manifest merger from merging it with another library's FileProvider, which would cause an "Attribute provider@authorities value=... is also present at..." conflict.
  • Authority remains ${applicationId}.fileprovider; no changes to StripeSdkModule.kt or CSV export sharing.

fixes: #2307

Motivation

When an app uses both @stripe/stripe-react-native and another library that declares a FileProvider (e.g. for document viewing), the Android manifest merger can report a conflict on the android:authorities attribute because both components use the same FileProvider class and similar or competing authorities. Using a dedicated subclass (StripeFileProvider) gives this library's provider a distinct android:name, so the merger keeps it separate and the conflict is resolved without requiring app-level tools:replace workarounds.

Testing

  • I tested this manually
  • I added automated tests

Documentation

Select one:

  • I have added relevant documentation for my changes.
  • This PR does not result in any developer-facing changes.

@huextrat huextrat requested review from a team as code owners February 16, 2026 17:14
@huextrat
Copy link
Contributor Author

FileProvider was added by @gimenete-stripe with #2298

Updates the file provider authority to prevent
potential conflicts with other libraries.
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.

Android: FileProvider manifest merge conflict with other libraries

1 participant