Fix misleading XA4243 error when more than one JavaArtifact is specified#11785
Merged
jonathanpeppers merged 2 commits intoJun 29, 2026
Merged
Conversation
Co-authored-by: jonathanpeppers <840039+jonathanpeppers@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix misleading XA4243 error for multiple JavaArtifacts
Fix misleading XA4243 error when more than one JavaArtifact is specified
Jun 29, 2026
simonrozsival
approved these changes
Jun 29, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes an incorrect/misleading MSBuild error code emitted when multiple JavaArtifact values are provided for a single item, by introducing a dedicated error code/message and using it in MavenExtensions.TryParseJavaArtifact.
Changes:
- Added new localized resource string/error code XA4256: “Only one '{0}' is allowed for '{1}' item '{2}'.”
- Updated
TryParseJavaArtifactto log XA4256 (instead of XA4243) when more than one artifact is specified. - Updated
Resources.Designer.csto expose the newXA4256resource.
Show a summary per file
| File | Description |
|---|---|
| src/Xamarin.Android.Build.Tasks/Utilities/MavenExtensions.cs | Emits XA4256 when JavaArtifact metadata specifies more than one artifact. |
| src/Xamarin.Android.Build.Tasks/Properties/Resources.resx | Adds the XA4256 localized string. |
| src/Xamarin.Android.Build.Tasks/Properties/Resources.Designer.cs | Adds the generated accessor for XA4256. |
Copilot's findings
Files not reviewed (1)
- src/Xamarin.Android.Build.Tasks/Properties/Resources.Designer.cs: Generated file
- Files reviewed: 2/3 changed files
- Comments generated: 1
jonathanpeppers
approved these changes
Jun 29, 2026
simonrozsival
approved these changes
Jun 29, 2026
rolfbjarne
approved these changes
Jun 29, 2026
simonrozsival
added a commit
that referenced
this pull request
Jun 29, 2026
) ## Summary Follow-up to the trimmable typemap manifest-generation work being split out of #11617 (and to the XA4243 manifest fix in #11785). This brings the **trimmable typemap** `ManifestGenerator` to parity with the legacy `ManifestDocument` for NativeAOT, completing the activity attribute coverage and the library/placeholder merge behavior that #11752 didn't cover. ## Changes * **`PropertyMapper`** — add the remaining activity manifest attributes: `banner`, `colorMode`, `enableVrMode`, `lockTaskMode`, `logo`, `maxAspectRatio`, `maxRecents`, `allowEmbedded`, `autoRemoveFromRecents`, `relinquishTaskIdentity`, `resumeWhilePausing`, `showForAllUsers`/`showOnLockScreen`/`showWhenLocked`, `singleUser`, `visibleToInstantApps`, `recreateOnConfigChanges`, `rotationAnimation`. Adds a `Number` mapping kind with invariant-culture formatting for `maxAspectRatio`/`maxRecents`. * **`ComponentElementBuilder`** — emit `<layout>` child properties from `LayoutProperties`. * **`ComponentInfo`** — carry `LayoutProperties`. * **`AndroidEnumConverter`** — `RotationAnimation` and `persistableMode` conversions. * **`ManifestGenerator`** — merge library (`.aar`) manifests for the legacy merger, resolve/normalize `$(AndroidManifestPlaceholders)` (incl. package-name resolution), warn XA1010 on invalid placeholders, sort component attributes alphabetically, dedup `tools:`-namespace nodes, and emit `uses-sdk` correctly when no min is specified. ## Context Part of slicing the #11617 mega-PR into reviewable units. `ManifestGenerator` and friends already exist on `main` (via #10991, #11037, #11143, #11752), so this applies cleanly on its own. Companion slices: #11794 (AndroidApplicationJavaClass/multidex). ## Tests Extends `ManifestGeneratorTests` to cover all activity attributes, layout properties, placeholder resolution/warnings, library-manifest merge, and dedup. **575 generator unit tests pass locally.**
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.
MavenExtensions.TryParseJavaArtifactreused XA4243 ("Attribute '{0}' is required...") when a user supplied more than oneJavaArtifact— a "missing-attribute" message for what is actually a "too many artifacts" problem. A stale TODO flagged the need for a dedicated message.Changes
Resources.resx/Resources.Designer.cs:Only one '{0}' is allowed for '{1}' item '{2}'.MavenExtensions.cs: log XA4256 instead of XA4243 onartifacts.Count > 1; removed TODO.