Skip to content

Fix copy-paste bug: targetSdkVersion gated on MinSdkVersion in CreateDynamicFeatureManifest - #12251

Merged
jonathanpeppers merged 2 commits into
mainfrom
copilot/fix-target-sdk-version-issue
Jul 29, 2026
Merged

Fix copy-paste bug: targetSdkVersion gated on MinSdkVersion in CreateDynamicFeatureManifest#12251
jonathanpeppers merged 2 commits into
mainfrom
copilot/fix-target-sdk-version-issue

Conversation

Copilot AI commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

In CreateDynamicFeatureManifest.GenerateFeatureManifest, both the minSdkVersion and targetSdkVersion attributes were guarded by !MinSdkVersion.IsNullOrEmpty() — a copy-paste error. This caused targetSdkVersion to be silently omitted when MinSdkVersion was empty, and threw ArgumentNullException when MinSdkVersion was set but TargetSdkVersion was null.

Change

Gate targetSdkVersion on TargetSdkVersion:

// Before
if (!MinSdkVersion.IsNullOrEmpty ())
    usesSdk.Add (new XAttribute (androidNS + "minSdkVersion", MinSdkVersion));
if (!MinSdkVersion.IsNullOrEmpty ())   // ← wrong variable
    usesSdk.Add (new XAttribute (androidNS + "targetSdkVersion", TargetSdkVersion));

// After
if (!MinSdkVersion.IsNullOrEmpty ())
    usesSdk.Add (new XAttribute (androidNS + "minSdkVersion", MinSdkVersion));
if (!TargetSdkVersion.IsNullOrEmpty ())
    usesSdk.Add (new XAttribute (androidNS + "targetSdkVersion", TargetSdkVersion));

…teDynamicFeatureManifest

Co-authored-by: jonathanpeppers <840039+jonathanpeppers@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix copy-paste bug in CreateDynamicFeatureManifest Fix copy-paste bug: targetSdkVersion gated on MinSdkVersion in CreateDynamicFeatureManifest Jul 28, 2026
Copilot AI requested a review from jonathanpeppers July 28, 2026 02:48
@jonathanpeppers
jonathanpeppers marked this pull request as ready for review July 28, 2026 13:05
Copilot AI review requested due to automatic review settings July 28, 2026 13:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes a logic bug in CreateDynamicFeatureManifest.GenerateFeatureManifest where emitting the targetSdkVersion manifest attribute was incorrectly gated on MinSdkVersion (copy/paste mistake). This ensures targetSdkVersion is produced when provided and avoids ArgumentNullException when only MinSdkVersion is set.

Changes:

  • Gate uses-sdk/@android:targetSdkVersion emission on TargetSdkVersion instead of MinSdkVersion.

@jonathanpeppers
jonathanpeppers enabled auto-merge (squash) July 28, 2026 17:04
@jonathanpeppers jonathanpeppers added the ready-to-review This PR is ready to review/merge, I think any CI failures are just flaky (ignorable). label Jul 28, 2026
@jonathanpeppers
jonathanpeppers merged commit eddc9f3 into main Jul 29, 2026
45 checks passed
@jonathanpeppers
jonathanpeppers deleted the copilot/fix-target-sdk-version-issue branch July 29, 2026 10:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-review This PR is ready to review/merge, I think any CI failures are just flaky (ignorable).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[fix-finder] Copy-paste bug: targetSdkVersion attribute gated on MinSdkVersion in CreateDynamicFeatureManifest

4 participants