Skip to content

fix: name the SDK's FileProvider so it stops colliding with the host's - #20

Merged
Shakibuzzaman3104 merged 1 commit into
mainfrom
fix/fileprovider-manifest-collision
Aug 20, 2026
Merged

Shakibuzzaman3104 merged 1 commit into
mainfrom
fix/fileprovider-manifest-collision

Conversation

@nur-shuvo

Copy link
Copy Markdown
Collaborator

A client hit this on integration: their debug build failed processProdDebugMainManifest with a merge conflict between their own FileProvider and DevConsole's.

Cause

The manifest merger keys <provider> nodes by android:name, not by authority. sdk:full declared its Share-sheet provider as androidx.core.content.FileProvider, so in any app that already declares a FileProvider of its own — camera capture, image picking, an attachment picker — the two collapsed into one node and the merge failed on the differing android:authorities and android.support.FILE_PROVIDER_PATHS resource.

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, mirroring DevConsoleForegroundService, so full.api is unchanged and no apiDump is needed. It takes its paths through FileProvider's resource-id constructor, so the declaration carries no meta-data child to collide over either.

The authority is unchanged, so InspectorDataScreen.shareFileFromPath needed 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-app now declares one under the raw AndroidX name for no reason other than to reproduce a host of that shape. :samples:compose-app:assembleDebug runs in verify.yml, so a reintroduction fails in CI instead of at a consumer.

Verified both directions: restoring the old android:name fails :samples:compose-app:processDebugMainManifest with the client's exact error, and the merged debug manifest otherwise carries both providers under distinct names.

Also here

  • docs/FAQ_TROUBLESHOOTING.md entry, including the one-line workaround for anyone stuck on 1.2.3.
  • The 1.2.4 bump across the same 15 files as Update version to 1.2.3 #16, plus the CHANGELOG section.

v1.2.4 should be tagged after this merges — DEFAULT_SDK_VERSION now points at 1.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 (needs ANDROID_HOME locally; CI provides it).
  • Full verify.yml command — green.

🤖 Generated with Claude Code

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>
@Shakibuzzaman3104
Shakibuzzaman3104 merged commit d850fd6 into main Aug 20, 2026
1 check passed
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.

2 participants