Repository navigation
fix: name the SDK's FileProvider so it stops colliding with the host's - #20
Merged
Merged
Conversation
The manifest merger keys <provider> nodes by android:name, not by authority, so declaring androidx.core.content.FileProvider in sdk:full made this provider and a host-declared one the same node. Any app that already shares files -- camera capture, image picking, an attachment picker -- failed its own debug build on the differing android:authorities and FILE_PROVIDER_PATHS resource, and the merger's suggested tools:replace fix silently drops the SDK authority instead, breaking the Files screen's Share action. The provider is now io.devconsole.DevConsoleFileProvider, which also takes its paths through FileProvider's resource-id constructor so the declaration has no meta-data child to collide over. The authority is unchanged, so nothing in a host app moves. samples:compose-app now declares a FileProvider under the raw AndroidX name for no reason other than to reproduce a host of that shape: :samples:compose-app: assembleDebug runs in CI, so a reintroduction fails there and not at a consumer. Bumps the release to 1.2.4. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
A client hit this on integration: their debug build failed
processProdDebugMainManifestwith a merge conflict between their ownFileProviderand DevConsole's.Cause
The manifest merger keys
<provider>nodes byandroid:name, not by authority.sdk:fulldeclared its Share-sheet provider asandroidx.core.content.FileProvider, so in any app that already declares aFileProviderof its own — camera capture, image picking, an attachment picker — the two collapsed into one node and the merge failed on the differingandroid:authoritiesandandroid.support.FILE_PROVIDER_PATHSresource.The merger's suggested
tools:replace="android:authorities"is a trap: it settles the conflict by dropping<applicationId>.devconsole.files, so the Files screen's Share action throws the first time someone taps it.Fix
The provider is now
io.devconsole.DevConsoleFileProvider—internal, mirroringDevConsoleForegroundService, sofull.apiis unchanged and noapiDumpis needed. It takes its paths throughFileProvider's resource-id constructor, so the declaration carries no meta-data child to collide over either.The authority is unchanged, so
InspectorDataScreen.shareFileFromPathneeded no edit and no host app has to move.Regression guard
None of the three samples declared a
FileProvider, which is why this reached a consumer.samples:compose-appnow declares one under the raw AndroidX name for no reason other than to reproduce a host of that shape.:samples:compose-app:assembleDebugruns inverify.yml, so a reintroduction fails in CI instead of at a consumer.Verified both directions: restoring the old
android:namefails:samples:compose-app:processDebugMainManifestwith the client's exact error, and the merged debug manifest otherwise carries both providers under distinct names.Also here
docs/FAQ_TROUBLESHOOTING.mdentry, including the one-line workaround for anyone stuck on 1.2.3.v1.2.4should be tagged after this merges —DEFAULT_SDK_VERSIONnow points at1.2.4, and the tag has to exist before that resolves on JitPack.Checks
:sdk:full:verifyQuality,:samples:compose-app:verifyQuality— green../gradlew -p gradle-plugin test— green (needsANDROID_HOMElocally; CI provides it).verify.ymlcommand — green.🤖 Generated with Claude Code