From 66aa756331114f07ecb5cab3af30e88162244e64 Mon Sep 17 00:00:00 2001 From: "Md. Asaduzzaman Nur" Date: Thu, 20 Aug 2026 13:29:26 +0600 Subject: [PATCH] fix: name the SDK's FileProvider so it stops colliding with the host's The manifest merger keys 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 --- CHANGELOG.md | 21 ++++++++++++++++++ README.md | 14 ++++++------ .../buildlogic/PublishingConventionPlugin.kt | 2 +- docs/BUILD_VARIANTS_AND_PRODUCTION_SAFETY.md | 2 +- docs/FAQ_TROUBLESHOOTING.md | 12 ++++++++++ docs/GETTING_STARTED_COMPOSE.md | 2 +- docs/GETTING_STARTED_XML_KOTLIN.md | 2 +- docs/MIGRATION.md | 4 ++-- docs/PUBLISHING.md | 4 ++-- docs/REMOTE_CONFIG.md | 2 +- gradle-plugin/build.gradle.kts | 2 +- .../gradle/DevConsoleVariantPolicyPlugin.kt | 6 ++--- ...onsoleVariantPolicyPluginFunctionalTest.kt | 12 +++++----- samples/compose-app/build.gradle.kts | 2 +- .../compose-app/src/main/AndroidManifest.xml | 17 ++++++++++++++ .../res/xml/sample_file_provider_paths.xml | 9 ++++++++ samples/foundation-app/build.gradle.kts | 2 +- samples/views-java-app/build.gradle.kts | 2 +- sdk/full/src/main/AndroidManifest.xml | 14 ++++++------ .../io/devconsole/DevConsoleFileProvider.kt | 22 +++++++++++++++++++ .../xml/devconsole_file_provider_paths.xml | 4 +++- sdk/storage-room/README.md | 2 +- 22 files changed, 121 insertions(+), 38 deletions(-) create mode 100644 samples/compose-app/src/main/res/xml/sample_file_provider_paths.xml create mode 100644 sdk/full/src/main/kotlin/io/devconsole/DevConsoleFileProvider.kt diff --git a/CHANGELOG.md b/CHANGELOG.md index 373960f..84d12e2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,27 @@ before it can reach a release. (There was briefly a separate `sdk:plugin-api` mo third-party plugin framework; it was removed before ever shipping — see Removed, below — so it never joined this list.) +## 1.2.4 — 2026-08-20 + +### Fixed + +- **The SDK's `FileProvider` no longer collides with the host's, which broke integration outright.** + `sdk:full` declared its Share-sheet provider as `androidx.core.content.FileProvider`, and the + manifest merger keys `` nodes by `android:name` rather than by authority — 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 host's debug build failed on the differing + `android:authorities` and `android.support.FILE_PROVIDER_PATHS` resource. The provider is now + `io.devconsole.DevConsoleFileProvider`, a name no host would pick, and it reaches its paths through + `FileProvider`'s resource-id constructor so the declaration carries no meta-data child to collide + over either. The authority is unchanged (`.devconsole.files`), so nothing in a host + app moves and no host that already built keeps working differently. Anyone still on 1.2.3 should + not apply the `tools:replace="android:authorities"` the merger suggests — it settles the conflict + by dropping the SDK's authority, and the Files screen's Share action then throws the first time it + is used; [docs/FAQ_TROUBLESHOOTING.md](docs/FAQ_TROUBLESHOOTING.md) has the one-line workaround + that keeps both providers. `samples:compose-app` now declares a FileProvider of its own for no + reason other than to reproduce a host of that shape, so CI fails on a reintroduction instead of a + consumer's build doing it. + ## 1.2.3 — 2026-08-18 ### Changed diff --git a/README.md b/README.md index f49f018..c7b4422 100644 --- a/README.md +++ b/README.md @@ -51,12 +51,12 @@ dependencyResolutionManagement { ```kotlin plugins { id("com.android.application") - id("io.github.devconsole-android") version "1.2.3" + id("io.github.devconsole-android") version "1.2.4" } dependencies { - debugImplementation("com.github.devconsole-android.DevConsole:devconsole:1.2.3") - releaseImplementation("com.github.devconsole-android.DevConsole:devconsole-noop:1.2.3") + debugImplementation("com.github.devconsole-android.DevConsole:devconsole:1.2.4") + releaseImplementation("com.github.devconsole-android.DevConsole:devconsole-noop:1.2.4") } ``` @@ -353,8 +353,8 @@ Add the adapter — it is not part of the `devconsole` umbrella, so that Firebas classpath of an app that doesn't use it: ```kotlin -debugImplementation("com.github.devconsole-android.DevConsole:devconsole-remote-config-firebase:1.2.3") -releaseImplementation("com.github.devconsole-android.DevConsole:devconsole-remote-config-firebase-noop:1.2.3") +debugImplementation("com.github.devconsole-android.DevConsole:devconsole-remote-config-firebase:1.2.4") +releaseImplementation("com.github.devconsole-android.DevConsole:devconsole-remote-config-firebase-noop:1.2.4") ``` > These two artifacts first ship in `1.2.0`; earlier versions do not have them. @@ -429,8 +429,8 @@ You never name those. Every module publishes sources, javadoc, and a POM. ### Versions and unreleased code All 34 library artifacts come from [JitPack](https://jitpack.io/#devconsole-android/DevConsole), -which builds a ref on demand. Releases are tagged `v1.2.3`, and JitPack resolves a bare version -against the `v`-prefixed tag, which is why the coordinates above read `1.2.3` — the same spelling +which builds a ref on demand. Releases are tagged `v1.2.4`, and JitPack resolves a bare version +against the `v`-prefixed tag, which is why the coordinates above read `1.2.4` — the same spelling the Gradle plugin uses on the Portal. Any branch works as `-SNAPSHOT`, with `/` written as `~`, so a `feature/x` branch is `feature~x-SNAPSHOT` — that is how you try an unreleased fix before it ships. JitPack support starts at **1.1.1**; earlier tags do not build there. Two things to diff --git a/build-logic/convention-publishing/src/main/kotlin/io/devconsole/buildlogic/PublishingConventionPlugin.kt b/build-logic/convention-publishing/src/main/kotlin/io/devconsole/buildlogic/PublishingConventionPlugin.kt index 585e232..5a29f6a 100644 --- a/build-logic/convention-publishing/src/main/kotlin/io/devconsole/buildlogic/PublishingConventionPlugin.kt +++ b/build-logic/convention-publishing/src/main/kotlin/io/devconsole/buildlogic/PublishingConventionPlugin.kt @@ -74,7 +74,7 @@ class PublishingConventionPlugin : Plugin { // The POM group. JitPack rewrites it to com.github.devconsole-android.DevConsole when it // serves a build, so consumers name that group, not this one. const val MAVEN_GROUP = "io.github.devconsole-android" - const val SDK_VERSION = "1.2.3" + const val SDK_VERSION = "1.2.4" const val PROJECT_URL = "https://github.com/devconsole-android/DevConsole" } } diff --git a/docs/BUILD_VARIANTS_AND_PRODUCTION_SAFETY.md b/docs/BUILD_VARIANTS_AND_PRODUCTION_SAFETY.md index 53491c5..0d495a5 100644 --- a/docs/BUILD_VARIANTS_AND_PRODUCTION_SAFETY.md +++ b/docs/BUILD_VARIANTS_AND_PRODUCTION_SAFETY.md @@ -37,7 +37,7 @@ devConsole { protectedDependencyPaths.set(setOf(":sdk:full")) // default; override for a differently-pathed module failBuildOnUnsafeVariant.set(true) // default; false downgrades to a warning autoWireDependencies.set(true) // default; false to declare coordinates yourself - sdkVersion.set("1.2.3") // default; the JitPack version to resolve + sdkVersion.set("1.2.4") // default; the JitPack version to resolve } ``` diff --git a/docs/FAQ_TROUBLESHOOTING.md b/docs/FAQ_TROUBLESHOOTING.md index d6669f3..bfb164c 100644 --- a/docs/FAQ_TROUBLESHOOTING.md +++ b/docs/FAQ_TROUBLESHOOTING.md @@ -54,6 +54,18 @@ only one is live at a time, and each lasts five minutes. There's no approval ste no automatic regeneration, so issue a fresh code from the More screen for each new browser. See [LAN_PERMISSION_AND_TROUBLESHOOTING.md](LAN_PERMISSION_AND_TROUBLESHOOTING.md#session-codes-session_code_expired--session_code_invalid). +**My debug build fails with a manifest merger conflict on `androidx.core.content.FileProvider`.** +Upgrade to 1.2.4, where the SDK declares its provider as `io.devconsole.DevConsoleFileProvider` +instead. The merger keys `` nodes by `android:name` rather than by authority, so through +1.2.3 the SDK's provider and the one your app already declares — for camera capture, image picking, +or any share sheet — were the same node, and the merge failed on the differing `android:authorities` +and paths resource. Do not apply the `tools:replace="android:authorities"` the merger suggests: it +resolves the conflict by dropping `.devconsole.files`, so the Files screen's Share +action throws the first time someone taps it. If you cannot upgrade yet, give *your* provider a +unique class name instead — `class AppFileProvider : FileProvider()`, with `android:name` pointing +at it — which keeps your authority, your paths file, and every `getUriForFile` call exactly as they +are. + **Where do I report a security issue?** Privately, never in a public issue. [SECURITY.md](../SECURITY.md) has the details. diff --git a/docs/GETTING_STARTED_COMPOSE.md b/docs/GETTING_STARTED_COMPOSE.md index cd0d4cc..0f21cd7 100644 --- a/docs/GETTING_STARTED_COMPOSE.md +++ b/docs/GETTING_STARTED_COMPOSE.md @@ -35,7 +35,7 @@ devConsole { } ``` -`` is a JitPack version — `1.2.3` for the current release. Releases are tagged `v1.2.3`, +`` is a JitPack version — `1.2.4` for the current release. Releases are tagged `v1.2.4`, and JitPack resolves a bare version against the `v`-prefixed tag, so the `v` is optional; the bare form is used here because it also matches the plugin's version on the Gradle Plugin Portal. diff --git a/docs/GETTING_STARTED_XML_KOTLIN.md b/docs/GETTING_STARTED_XML_KOTLIN.md index eb7558d..ebed87a 100644 --- a/docs/GETTING_STARTED_XML_KOTLIN.md +++ b/docs/GETTING_STARTED_XML_KOTLIN.md @@ -35,7 +35,7 @@ devConsole { } ``` -`` is a JitPack version — `1.2.3` for the current release. Releases are tagged `v1.2.3`, +`` is a JitPack version — `1.2.4` for the current release. Releases are tagged `v1.2.4`, and JitPack resolves a bare version against the `v`-prefixed tag, so the `v` is optional; the bare form is used here because it also matches the plugin's version on the Gradle Plugin Portal. diff --git a/docs/MIGRATION.md b/docs/MIGRATION.md index 282930a..0e86197 100644 --- a/docs/MIGRATION.md +++ b/docs/MIGRATION.md @@ -31,8 +31,8 @@ dependencyResolutionManagement { `v*` release tag: ```kotlin -debugImplementation("com.github.devconsole-android.DevConsole:devconsole:1.2.3") -releaseImplementation("com.github.devconsole-android.DevConsole:devconsole-noop:1.2.3") +debugImplementation("com.github.devconsole-android.DevConsole:devconsole:1.2.4") +releaseImplementation("com.github.devconsole-android.DevConsole:devconsole-noop:1.2.4") ``` If you rely on the plugin's `autoWireDependencies` (the default), step 2 is done for you — you only diff --git a/docs/PUBLISHING.md b/docs/PUBLISHING.md index 6101dba..45c2092 100644 --- a/docs/PUBLISHING.md +++ b/docs/PUBLISHING.md @@ -96,8 +96,8 @@ dependencies { ``` `` is a git ref. JitPack looks it up as a tag and falls back to the `v`-prefixed spelling -when no bare tag exists, so a release resolves either way — `1.2.3` and `v1.2.3` both serve the -`v1.2.3` build. Prefer the bare form: it is what the docs show, and it matches the version the +when no bare tag exists, so a release resolves either way — `1.2.4` and `v1.2.4` both serve the +`v1.2.4` build. Prefer the bare form: it is what the docs show, and it matches the version the Gradle plugin carries on the Portal. Any branch works as `-SNAPSHOT`, with `/` written as `~`, so a `feature/x` branch is `feature~x-SNAPSHOT`. JitPack support starts at **1.1.1**; earlier tags do not build there, and bare `1.2.1` is a cached failed build — that one release resolves only diff --git a/docs/REMOTE_CONFIG.md b/docs/REMOTE_CONFIG.md index a98853d..3a0dd01 100644 --- a/docs/REMOTE_CONFIG.md +++ b/docs/REMOTE_CONFIG.md @@ -29,7 +29,7 @@ debugImplementation("com.github.devconsole-android.DevConsole:devconsole-remote- releaseImplementation("com.github.devconsole-android.DevConsole:devconsole-remote-config-firebase-noop:") ``` -`` is a JitPack version — `1.2.3` for the current release. Releases are tagged `v1.2.3`, +`` is a JitPack version — `1.2.4` for the current release. Releases are tagged `v1.2.4`, and JitPack resolves a bare version against the `v`-prefixed tag, so the `v` is optional; the bare form is used here because it also matches the plugin's version on the Gradle Plugin Portal. diff --git a/gradle-plugin/build.gradle.kts b/gradle-plugin/build.gradle.kts index 59b3530..e80c432 100644 --- a/gradle-plugin/build.gradle.kts +++ b/gradle-plugin/build.gradle.kts @@ -9,7 +9,7 @@ plugins { // Must share a top-level namespace with the plugin ID (a Plugin Portal requirement) and match // the SDK's Maven group. group = "io.github.devconsole-android" -version = "1.2.3" +version = "1.2.4" // Targets Java 17: this plugin JAR runs inside the Gradle daemon (AGP 8.13.0 // requires JDK 17) and compiles against com.android.tools.build:gradle:8.13.0, diff --git a/gradle-plugin/src/main/kotlin/io/devconsole/gradle/DevConsoleVariantPolicyPlugin.kt b/gradle-plugin/src/main/kotlin/io/devconsole/gradle/DevConsoleVariantPolicyPlugin.kt index 81199e1..9dbebaf 100644 --- a/gradle-plugin/src/main/kotlin/io/devconsole/gradle/DevConsoleVariantPolicyPlugin.kt +++ b/gradle-plugin/src/main/kotlin/io/devconsole/gradle/DevConsoleVariantPolicyPlugin.kt @@ -398,10 +398,10 @@ abstract class VerifyDevConsolePackagedArtifactTask : DefaultTask() { } // JitPack serves a build under its git ref name. This repo tags `v*`, and JitPack resolves a -// requested version against the `v`-prefixed tag when no bare tag exists, so "1.2.3" reaches the -// v1.2.3 build -- and reads the same as the version this plugin carries on the Plugin Portal. +// requested version against the `v`-prefixed tag when no bare tag exists, so "1.2.4" reaches the +// v1.2.4 build -- and reads the same as the version this plugin carries on the Plugin Portal. // Bump in step with SDK_VERSION in convention-publishing; the tag must exist before this resolves. -private const val DEFAULT_SDK_VERSION = "1.2.3" +private const val DEFAULT_SDK_VERSION = "1.2.4" /** JitPack's group for this repo — what auto-wiring declares. */ private const val DEVCONSOLE_GROUP = "com.github.devconsole-android.DevConsole" diff --git a/gradle-plugin/src/test/kotlin/io/devconsole/gradle/DevConsoleVariantPolicyPluginFunctionalTest.kt b/gradle-plugin/src/test/kotlin/io/devconsole/gradle/DevConsoleVariantPolicyPluginFunctionalTest.kt index b35ce8d..530db31 100644 --- a/gradle-plugin/src/test/kotlin/io/devconsole/gradle/DevConsoleVariantPolicyPluginFunctionalTest.kt +++ b/gradle-plugin/src/test/kotlin/io/devconsole/gradle/DevConsoleVariantPolicyPluginFunctionalTest.kt @@ -870,12 +870,12 @@ class DevConsoleVariantPolicyPluginFunctionalTest { ) // release is PROTECTED by default, so auto-wire adds the noop core coordinate. The published - // coordinate is 1.2.3 -- the DEFAULT_SDK_VERSION must not point at a 1.2.3-SNAPSHOT that was + // coordinate is 1.2.4 -- the DEFAULT_SDK_VERSION must not point at a 1.2.4-SNAPSHOT that was // never published, which would make every zero-config release build fail to resolve. val result = runner("dependencies", "--configuration", "releaseImplementation").build() - assertTrue(result.output, result.output.contains("com.github.devconsole-android.DevConsole:devconsole-noop:1.2.3")) - assertTrue(result.output, !result.output.contains("1.2.3-SNAPSHOT")) + assertTrue(result.output, result.output.contains("com.github.devconsole-android.DevConsole:devconsole-noop:1.2.4")) + assertTrue(result.output, !result.output.contains("1.2.4-SNAPSHOT")) } @Test @@ -925,13 +925,13 @@ class DevConsoleVariantPolicyPluginFunctionalTest { @Test fun `the JitPack coordinate trips the declared-dependency check`() { - addStubCoordinate("com.github.devconsole-android.DevConsole", "devconsole", "1.2.3") + addStubCoordinate("com.github.devconsole-android.DevConsole", "devconsole", "1.2.4") writeFixture( devConsoleBlock = "autoWireDependencies.set(false)", extraBuildScript = """ dependencies { - add("releaseImplementation", "com.github.devconsole-android.DevConsole:devconsole:1.2.3") + add("releaseImplementation", "com.github.devconsole-android.DevConsole:devconsole:1.2.4") } """.trimIndent(), ) @@ -971,7 +971,7 @@ class DevConsoleVariantPolicyPluginFunctionalTest { // debug is ENABLED, so the core runtime ("devconsole") must still be auto-wired alongside the // host's add-on declaration -- the add-on alone does not count as declaring the core runtime. - assertTrue(result.output, result.output.contains("com.github.devconsole-android.DevConsole:devconsole:1.2.3")) + assertTrue(result.output, result.output.contains("com.github.devconsole-android.DevConsole:devconsole:1.2.4")) assertTrue(result.output, result.output.contains("io.github.devconsole-android:devconsole-ui-compose")) } diff --git a/samples/compose-app/build.gradle.kts b/samples/compose-app/build.gradle.kts index af7e48f..d8dcb2e 100644 --- a/samples/compose-app/build.gradle.kts +++ b/samples/compose-app/build.gradle.kts @@ -12,7 +12,7 @@ android { defaultConfig { applicationId = "io.devconsole.sample.compose" versionCode = 1 - versionName = "1.2.3-SNAPSHOT" + versionName = "1.2.4-SNAPSHOT" } } diff --git a/samples/compose-app/src/main/AndroidManifest.xml b/samples/compose-app/src/main/AndroidManifest.xml index 129b059..2f799c7 100644 --- a/samples/compose-app/src/main/AndroidManifest.xml +++ b/samples/compose-app/src/main/AndroidManifest.xml @@ -5,6 +5,23 @@ confined to src/debug/AndroidManifest.xml. --> + + + + diff --git a/samples/compose-app/src/main/res/xml/sample_file_provider_paths.xml b/samples/compose-app/src/main/res/xml/sample_file_provider_paths.xml new file mode 100644 index 0000000..076ada9 --- /dev/null +++ b/samples/compose-app/src/main/res/xml/sample_file_provider_paths.xml @@ -0,0 +1,9 @@ + + + + + diff --git a/samples/foundation-app/build.gradle.kts b/samples/foundation-app/build.gradle.kts index 0d80a7f..32c0fa7 100644 --- a/samples/foundation-app/build.gradle.kts +++ b/samples/foundation-app/build.gradle.kts @@ -31,6 +31,6 @@ android { defaultConfig { applicationId = "io.devconsole.sample" versionCode = 1 - versionName = "1.2.3-SNAPSHOT" + versionName = "1.2.4-SNAPSHOT" } } diff --git a/samples/views-java-app/build.gradle.kts b/samples/views-java-app/build.gradle.kts index d405569..a80321e 100644 --- a/samples/views-java-app/build.gradle.kts +++ b/samples/views-java-app/build.gradle.kts @@ -9,7 +9,7 @@ android { defaultConfig { applicationId = "io.devconsole.sample.viewsjava" versionCode = 1 - versionName = "1.2.3-SNAPSHOT" + versionName = "1.2.4-SNAPSHOT" } } diff --git a/sdk/full/src/main/AndroidManifest.xml b/sdk/full/src/main/AndroidManifest.xml index 5e2369e..19fdca1 100644 --- a/sdk/full/src/main/AndroidManifest.xml +++ b/sdk/full/src/main/AndroidManifest.xml @@ -12,16 +12,16 @@ android:initOrder="100" /> + file is always inside a root that inspector already permits browsing. The name is an + SDK-specific subclass on purpose: the merger keys providers by android:name, so naming + androidx.core.content.FileProvider here collided with every host that declares its own + (see DevConsoleFileProvider). That subclass hands FileProvider the paths resource + itself, so this declaration needs no meta-data child to collide over either. --> - - + android:grantUriPermissions="true" />